commit 1e88e6c506f0ee5a161c5b6db16171957bfcc567
parent 279ff651d05422e596ec8f8330f7a6b372550a7a
Author: GeaRSiX <gearsix@tuta.io>
Date: Fri, 31 Jan 2020 16:57:28 +0000
overwriting files moved the original to *.bak
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/dotfm.py b/src/dotfm.py
@@ -90,7 +90,9 @@ def dotfm_install(dotfile):
if len(oca) > 0:
if oca[0] == 'o':
LOGGER.info('overwriting {} with {}'.format(dest, dotfile))
- os.system('ln -fvs {} {}'.format(dotfile, dest))
+ LOGGER.info('backing up {}/{} -> {}/{}.bak'.format(dest, name, dest, name))
+ os.system('mv {}/{} {}/{}.bak'.format(dest, name, dest, name))
+ os.system('ln -vs {} {}'.format(dotfile, dest))
elif oca[0] == 'c':
LOGGER.info('comparing {} to {}/{}'.format(dotfile, dest, name))
os.system('diff {} {}/{}'.format(dotfile, dest, name)) # maybe use vimdiff