2013-08-10 22:32:49 +02:00
|
|
|
#!/usr/bin/env python
|
2013-08-12 01:45:11 +02:00
|
|
|
|
|
|
|
import os
|
|
|
|
import os.path
|
2013-08-10 22:32:49 +02:00
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
|
2013-08-12 01:45:11 +02:00
|
|
|
home = os.path.expanduser('~')
|
2013-08-12 01:55:41 +02:00
|
|
|
thisdir = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
bindir = os.path.join(home, 'bin')
|
2013-08-10 22:32:49 +02:00
|
|
|
try:
|
2013-08-12 01:45:11 +02:00
|
|
|
if not os.path.isdir(bindir):
|
|
|
|
os.path.mkdir(bindir)
|
2013-08-12 01:55:41 +02:00
|
|
|
os.symlink(os.path.join(thisdir, './cheat'), os.path.join(bindir, 'cheat'))
|
|
|
|
os.symlink(os.path.join(thisdir, './.cheat'), os.path.join(home, '.cheat'))
|
2013-08-12 01:45:11 +02:00
|
|
|
print("cheat has been installed successfully.")
|
2013-08-10 22:32:49 +02:00
|
|
|
except IOError as e:
|
2013-08-12 01:45:11 +02:00
|
|
|
sys.stderr.write("Something went wrong: %s\n" % e)
|
|
|
|
sys.stderr.write("Your installation may be incomplete!\n")
|
|
|
|
sys.exit(1)
|