def run_script(script, remote=True):
''' Run a script. '''
custom_scripts = _get_config()['scripts']
# If the script is not defined raise error.
if not is_script_defined(script):
raise RuntimeError('Missing script "{}"'.format(script))
# Get the command defined in the script.
script_cmd = custom_scripts[script]
info_text = 'Running {}\n{}'.format(
cyan(script), cyan('> ' + script_cmd)
)
host_info(info_text, remote=remote)
# Run a custom script defined in the config.
with hide('running'):
run(script_cmd, remote)
评论列表
文章目录