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('~')
|
|
|
|
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)
|
|
|
|
os.symlink('./cheat', bindir)
|
|
|
|
os.symlink('./.cheat', os.path.join(home, '/.cheat'))
|
|
|
|
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)
|