1
0
Fork 0
mirror of synced 2024-11-22 00:05:34 -05:00

Fix error reporting in link plugin

This commit is contained in:
ael-code 2016-11-19 16:42:02 +01:00 committed by Anish Athalye
parent b482cbda58
commit 58c8b98277

View file

@ -1,4 +1,7 @@
import os, shutil, dotbot import os
import shutil
import dotbot
class Link(dotbot.Plugin): class Link(dotbot.Plugin):
''' '''
@ -34,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(os.path.join(self._context.base_directory(), path)):
success = False
self._log.warning('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')