mirror of
1
0
Fork 0

Fix basepath bug

This commit is contained in:
Jonas De 2019-08-16 18:34:50 +02:00
parent 8be31d6fda
commit 49e3a325bd
1 changed files with 4 additions and 2 deletions

View File

@ -160,7 +160,9 @@ class Link(dotbot.Plugin):
source = os.path.join(self._context.base_directory(), source)
fullpath = os.path.expanduser(path)
if backup:
backup = os.path.expanduser(backup)
basename = os.path.basename(fullpath)
backup = os.path.join(os.path.expanduser(backup), basename)
if relative:
source = self._relative_path(source, fullpath)
if ((self._is_link(path) and self._link_destination(path) != source) or
@ -174,7 +176,7 @@ class Link(dotbot.Plugin):
if os.path.isdir(fullpath):
if backup:
self._log.lowinfo('Backing up %s -> %s' % (fullpath, backup))
shutil.copytree(fullpath, backup)
shutil.copytree(fullpath, backup+'/'+)
shutil.rmtree(fullpath)
removed = True
else: