diff options
| -rwxr-xr-x | setup.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -8,13 +8,18 @@ os.chdir(os.path.dirname(__file__)) exit = 0 for f in glob('dot.*'): - dst = os.path.expanduser('~/' + f[3:]) + dst = os.path.expanduser( + '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")) src = os.path.join(os.getcwd(), f) + src_rel = os.path.relpath(src, os.path.dirname(dst)) + + os.makedirs(os.path.dirname(dst), exist_ok=True) + try: - os.symlink(src, dst) + os.symlink(src_rel, dst) except FileExistsError: if not os.path.samefile(src, dst): - print(dst + " exists and does not link do " + dst) + print(dst + " exists and does not link do " + src) exit = 1 sys.exit(exit) |
