1
0
Fork 0
mirror of synced 2024-12-22 06:01:07 -05:00

Allow force and relink on glob items

This commit is contained in:
Ben Klein 2018-01-27 04:11:11 -05:00 committed by Anish Athalye
parent dece710399
commit 564d16fcd5

View file

@ -63,13 +63,15 @@ class Link(dotbot.Plugin):
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)
else: else:
self._log.lowinfo("Linking globbed items: " + str(glob_results)) self._log.lowinfo("Globs from '" + path + "': " + str(glob_results))
glob_base = path[:glob_star_loc] glob_base = path[:glob_star_loc]
for glob_full_item in glob_results: for glob_full_item in glob_results:
glob_item = glob_full_item[len(glob_base):] glob_item = glob_full_item[len(glob_base):]
glob_link_destination = destination + glob_item glob_link_destination = destination + glob_item
if create: if create:
success &= self._create(glob_link_destination) success &= self._create(glob_link_destination)
if force or relink:
success &= self._delete(glob_full_item, glob_link_destination, relative, force)
success &= self._link(glob_full_item, glob_link_destination, relative) success &= self._link(glob_full_item, glob_link_destination, relative)
else: else:
if create: if create: