mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 12:19:17 +00:00
adding default_actions and dotfile src/dst paths to template these (for #125)
This commit is contained in:
@@ -68,13 +68,16 @@ class Action(Cmd):
|
||||
def __repr__(self):
|
||||
return 'action({})'.format(self.__str__())
|
||||
|
||||
def execute(self):
|
||||
def execute(self, templater=None, newvars={}):
|
||||
"""execute the action in the shell"""
|
||||
ret = 1
|
||||
action = self.action
|
||||
if templater:
|
||||
action = templater.generate_string(self.action, tmpvars=newvars)
|
||||
try:
|
||||
cmd = self.action.format(*self.args)
|
||||
cmd = action.format(*self.args)
|
||||
except IndexError:
|
||||
err = 'bad action: \"{}\"'.format(self.action)
|
||||
err = 'bad action: \"{}\"'.format(action)
|
||||
err += ' with \"{}\"'.format(self.args)
|
||||
self.log.warn(err)
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user