diff options
| author | Thomas Schneider <qsx@chaotikum.eu> | 2019-12-24 15:04:01 +0100 |
|---|---|---|
| committer | Thomas Schneider <qsx@chaotikum.eu> | 2019-12-24 15:04:01 +0100 |
| commit | f3e66345a3b1348a35c795d8768c6dbbcc09b8a3 (patch) | |
| tree | d04f3eb3e92fc0bd5825f992b7354d11d5d7aea3 /install.py | |
| parent | cea1d28cff6d72538a8c0ab87f3da1c17c9a98ac (diff) | |
Rename setup.py to install.py
The name setup.py is associated with things that this one is not.
Diffstat (limited to 'install.py')
| -rwxr-xr-x | install.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/install.py b/install.py new file mode 100755 index 0000000..bd58299 --- /dev/null +++ b/install.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import os +import sys +from glob import glob + +os.chdir(os.path.dirname(__file__)) +exit = 0 + +for f in glob('dot.*'): + 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_rel, dst) + except FileExistsError: + if not os.path.samefile(src, dst): + print(dst + " exists and does not link do " + src) + exit = 1 + +sys.exit(exit) |
