Skip to content

Commit

Permalink
Merge branch 'ael-code/skip_nonexisting'
Browse files Browse the repository at this point in the history
  • Loading branch information
anishathalye committed Nov 19, 2016
2 parents 295f8e3 + 58c8b98 commit 4468fff
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions plugins/link.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import os, shutil, dotbot
import os
import shutil
import dotbot


class Link(dotbot.Plugin):
'''
Expand Down Expand Up @@ -34,11 +37,15 @@ def _process_links(self, links):
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')
Expand Down

0 comments on commit 4468fff

Please sign in to comment.