diff options
author | ael-code <tommy.ael@gmail.com> | 2016-11-19 16:42:02 +0100 |
---|---|---|
committer | Anish Athalye <me@anishathalye.com> | 2016-11-19 10:27:13 -0600 |
commit | 58c8b9827767114b1ff77c08766ce91122d4bc8b (patch) | |
tree | f8d67a2f495f2ddb924daaee7e1954682c69d87f | |
parent | b482cbda585848c0d5f5345711fe338e319c0adf (diff) |
Fix error reporting in link plugin
-rw-r--r-- | plugins/link.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/link.py b/plugins/link.py index ff8685e..3c7b8d4 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -1,4 +1,7 @@ -import os, shutil, dotbot +import os +import shutil +import dotbot + class Link(dotbot.Plugin): ''' @@ -34,11 +37,15 @@ class Link(dotbot.Plugin): else: path = source path = os.path.expandvars(os.path.expanduser(path)) + if not self._exists(os.path.join(self._context.base_directory(), path)): + success = False + self._log.warning('Nonexistent target %s -> %s' % + (destination, path)) + continue if create: success &= self._create(destination) if force or relink: - if self._exists(path): - success &= self._delete(path, destination, relative, force) + success &= self._delete(path, destination, relative, force) success &= self._link(path, destination, relative) if success: self._log.info('All links have been set up') |