1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-09 04:14:17 +00:00

allow to update entire profile

This commit is contained in:
deadc0de6
2019-03-10 16:14:32 +01:00
parent 25ac6fa84f
commit afd91226a8
2 changed files with 17 additions and 1 deletions

View File

@@ -173,6 +173,22 @@ def cmd_update(o):
ignore = o.update_ignore
showpatch = o.update_showpatch
if not paths:
# update the entire profile
if iskey:
paths = [d.key for d in o.dotfiles]
else:
paths = [d.dst for d in o.dotfiles]
msg = 'Update all dotfiles for profile {}'.format(o.profile)
if o.safe and not LOG.ask(msg):
return False
if not paths:
LOG.log('no dotfile to update')
return True
if o.debug:
LOG.dbg('dotfile to update: {}'.format(paths))
updater = Updater(o.dotpath, o.dotfiles, o.variables,
dry=o.dry, safe=o.safe, debug=o.debug,
ignore=ignore, showpatch=showpatch)