#!/usr/bin/env python import os import os.path import shutil import sys home = os.path.expanduser('~') bindir = os.path.join(home, '/bin/') try: 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.") except IOError as e: sys.stderr.write("Something went wrong: %s\n" % e) sys.stderr.write("Your installation may be incomplete!\n") sys.exit(1)