Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def git(*args, **kwargs):
return call('git', *args, **kwargs)
# Enter the working tree
shell.cd(self.name)
if not git.valid():
raise self._invalid_repository
# Check for scripts
if not self.scripts:
common.show("(no scripts to run)", color='shell_info')
common.newline()
return
# Run all scripts
for script in self.scripts:
try:
lines = shell.call(script, _shell=True)
except exceptions.ShellError as exc:
common.show(*exc.output, color='shell_error')
cmd = exc.program
if force:
log.debug("Ignored error from call to '%s'", cmd)
else:
msg = "Command '{}' failed in {}".format(cmd, os.getcwd())
raise exceptions.ScriptFailure(msg)
else:
common.show(*lines, color='shell_output')
common.newline()
def gitsvn(*args, **kwargs):
return call('git', 'svn', *args, **kwargs)