diff options
| author | Thomas Schneider <qsx@qsx.re> | 2017-08-08 16:18:41 +0200 |
|---|---|---|
| committer | Thomas Schneider <qsx@qsx.re> | 2017-08-08 16:18:41 +0200 |
| commit | d47b9983528647d1862169ef3f8446131385f509 (patch) | |
| tree | ad2cb3de99f6346614026560e7e5cdbc93338957 /setup.py | |
| parent | ebe2122fb7814f62e42e5356aa264eecb6bf8ec2 (diff) | |
setup.py: Apply some of TobiX’ modifications
Signed-off-by: Thomas Schneider <qsx@qsx.re>
Diffstat (limited to 'setup.py')
| -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) |
