link plugin: skip entries with nonexisting target
This commit is contained in:
parent
57fddb56d4
commit
dae8c89880
1 changed files with 6 additions and 2 deletions
|
@ -37,11 +37,15 @@ class Link(dotbot.Plugin):
|
||||||
else:
|
else:
|
||||||
path = source
|
path = source
|
||||||
path = os.path.expandvars(os.path.expanduser(path))
|
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:
|
if create:
|
||||||
success &= self._create(destination)
|
success &= self._create(destination)
|
||||||
if force or relink:
|
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)
|
success &= self._link(path, destination, relative)
|
||||||
if success:
|
if success:
|
||||||
self._log.info('All links have been set up')
|
self._log.info('All links have been set up')
|
||||||
|
|
Loading…
Reference in a new issue