From 28f63469af2fc00d62a866ce08abf4677de315aa Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Sat, 27 Aug 2011 10:07:09 -0400 Subject: Fix forced sync when the dotfile is a directory I installed the lastpass chrome extension which stores a socket in ~/.lastpass. So I added that directory as an external to /tmp and attempted a forced sync. An error occurred because sync() calls os.remove() as it mistakenly assumes the dotfile is a file and not a directory. --- dotfiles/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dotfiles/core.py b/dotfiles/core.py index a1ee264..a288f69 100644 --- a/dotfiles/core.py +++ b/dotfiles/core.py @@ -38,7 +38,10 @@ class Dotfile(object): if not force: print "Skipping \"%s\", use --force to override" % self.basename return - os.remove(self.name) + if os.path.isdir(self.name): + shutil.rmtree(self.name) + else: + os.remove(self.name) os.symlink(self.target, self.name) def add(self): -- cgit v1.2.3