From dae8c89880404ae0a5518d91528a3ac41cd4133e Mon Sep 17 00:00:00 2001 From: ael-code Date: Sat, 19 Nov 2016 16:44:11 +0100 Subject: [PATCH] link plugin: skip entries with nonexisting target --- plugins/link.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/link.py b/plugins/link.py index d839aad..94155ee 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -37,11 +37,15 @@ class Link(dotbot.Plugin): else: path = source path = os.path.expandvars(os.path.expanduser(path)) + if not self._exists(path): + success = False + self._log.warning('Skipping 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')