1
0
Fork 0
mirror of synced 2024-06-15 13:51:08 -04:00

Add backup print

This commit is contained in:
Jonas De 2019-08-16 18:08:42 +02:00
parent b3468af3b3
commit 294e3e980a

View file

@ -173,12 +173,14 @@ class Link(dotbot.Plugin):
elif force:
if os.path.isdir(fullpath):
if backup:
self._log.lowinfo('Backing up %s -> %s' % (fullpath, backup))
shutil.copytree(fullpath, backup)
shutil.rmtree(fullpath)
removed = True
else:
if backup:
shutil.copyfile(fullpath, backup)
self._log.lowinfo('Backing up %s -> %s' % (fullpath, backup))
os.remove(fullpath)
removed = True
except OSError: