def get_executer(self, name): runner = self.argument('exec') if runner: return runner config = Config.script(name) runner = config.get('exec') return runner or self.default_executer
def run_script(self, name): config = Config.script(name) script_root = Config.script_root() if not config: raise CommandError('No such script: {}'.format(name)) file = config.get('file') if not file: raise CommandError('Script does not have file') if script_root and file[0] != '/': file_path = script_root / file else: file_path = file runner = self.get_executer(name) command = '{} {}'.format(runner, file_path) self.line('Run command: {}'.format(command)) self.shell_call(command) return True