From ff5e55c477086ad427c2a2974e4fc0a289178f0e Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Sat, 29 Dec 2018 10:36:29 -0400 Subject: [PATCH 1/2] Fix bug with linking to broken symlink This adjustment fixes the exception thrown when `link()` is called with the destination being a broken symlink and having a trailing `/`. `os.path.lexists(dst)` (called [here](https://github.com/deadc0de6/dotdrop/blob/0dd9dea1ffa76155c95dbad8f741764fb04a1316/dotdrop/installer.py#L85)) only returns true for broken symlinks without the trailing `/`. --- dotdrop/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 71bb2d2..285e0ab 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -64,7 +64,7 @@ class Installer: if not os.path.exists(src): self.log.err('source dotfile does not exist: {}'.format(src)) return [] - dst = os.path.expanduser(dst) + dst = os.path.expanduser(dst).rstrip('/') if self.totemp: # ignore actions return self.install(templater, src, dst, actions=[]) From 86aa261d0553b15fafa57fd571462e9d62dc380c Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sat, 29 Dec 2018 18:20:51 +0100 Subject: [PATCH 2/2] generic os separator --- dotdrop/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 285e0ab..8b6a71a 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -64,7 +64,7 @@ class Installer: if not os.path.exists(src): self.log.err('source dotfile does not exist: {}'.format(src)) return [] - dst = os.path.expanduser(dst).rstrip('/') + dst = os.path.expanduser(dst).rstrip(os.sep) if self.totemp: # ignore actions return self.install(templater, src, dst, actions=[])