From 49e3a325bd42eca38a4c98b53a5433bf345cf4c4 Mon Sep 17 00:00:00 2001 From: Jonas De Date: Fri, 16 Aug 2019 18:34:50 +0200 Subject: [PATCH] Fix basepath bug --- dotbot/plugins/link.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dotbot/plugins/link.py b/dotbot/plugins/link.py index 07969e5..daa7860 100644 --- a/dotbot/plugins/link.py +++ b/dotbot/plugins/link.py @@ -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: