mirror of
1
0
Fork 0

Add backup print

This commit is contained in:
Jonas De 2019-08-16 18:08:42 +02:00
parent b3468af3b3
commit 294e3e980a
1 changed files with 2 additions and 0 deletions

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: