def get_new_command(command): cmds = command.script_parts machine = None if len(cmds) >= 3: machine = cmds[2] startAllInstances = shell.and_("vagrant up", command.script) if machine is None: return startAllInstances else: return [shell.and_("vagrant up " + machine, command.script), startAllInstances]
def get_new_command(command): missing_file = re.findall( r"error: pathspec '([^']*)' " r'did not match any file\(s\) known to git.', command.stderr)[0] formatme = shell.and_('git add -- {}', '{}') return formatme.format(missing_file, command.script)
def get_new_command(command): branch_name = re.findall( r"fatal: A branch named '([^']*)' already exists.", command.stderr)[0] new_command_templates = [['git branch -d {0}', 'git branch {0}'], ['git branch -D {0}', 'git branch {0}'], ['git checkout {0}']] for new_command_template in new_command_templates: yield shell.and_(*new_command_template).format(branch_name)
def get_new_command(command): packages = get_pkgfile(command.script) formatme = shell.and_('{} -S {}', '{}') return [ formatme.format(pacman, package, command.script) for package in packages ]
def get_new_command(command): for pattern in patterns: file = re.findall(pattern, command.stderr) if file: file = file[0] dir = file[0:file.rfind('/')] formatme = shell.and_('mkdir -p {}', '{}') return formatme.format(dir, command.script)
def get_new_command(command): for pattern in patterns: file = re.findall(pattern, command.stderr) if file: file = file[0] dir = file[0:file.rfind('/')] formatme = shell.and_('mkdir -p {}', '{}') return formatme.format(dir, command.script)
def get_new_command(command): missing_file = re.findall( r"error: pathspec '([^']*)' " r"did not match any file\(s\) known to git.", command.stderr)[0] closest_branch = utils.get_closest(missing_file, get_branches(), fallback_to_first=False) if closest_branch: return replace_argument(command.script, missing_file, closest_branch) else: return shell.and_('git branch {}', '{}').format( missing_file, command.script)
def get_new_command(command): missing_file = re.findall( r"error: pathspec '([^']*)' " r"did not match any file\(s\) known to git.", command.stderr)[0] closest_branch = utils.get_closest(missing_file, get_branches(), fallback_to_first=False) if closest_branch: return replace_argument(command.script, missing_file, closest_branch) else: return shell.and_('git branch {}', '{}').format(missing_file, command.script)
def get_new_command(command): m = _search(command.stderr) or _search(command.stdout) # Note: there does not seem to be a standard for columns, so they are just # ignored by default if settings.fixcolcmd and 'col' in m.groupdict(): editor_call = settings.fixcolcmd.format(editor=os.environ['EDITOR'], file=m.group('file'), line=m.group('line'), col=m.group('col')) else: editor_call = settings.fixlinecmd.format(editor=os.environ['EDITOR'], file=m.group('file'), line=m.group('line')) return shell.and_(editor_call, command.script)
def get_new_command(command): m = _search(command.stderr) or _search(command.stdout) # Note: there does not seem to be a standard for columns, so they are just # ignored by default if settings.fixcolcmd and 'col' in m.groupdict(): editor_call = settings.fixcolcmd.format(editor=os.environ['EDITOR'], file=m.group('file'), line=m.group('line'), col=m.group('col')) else: editor_call = settings.fixlinecmd.format(editor=os.environ['EDITOR'], file=m.group('file'), line=m.group('line')) return shell.and_(editor_call, command.script)
def get_new_command(command): dir = shell.quote(_tar_file(command.script_parts)[1]) return shell.and_('mkdir -p {dir}', '{cmd} -C {dir}') \ .format(dir=dir, cmd=command.script)
def get_new_command(command): return shell.and_('chmod +x {}'.format(command.script_parts[0][2:]), command.script)
def get_new_command(command): return shell.and_(replace_argument(command.script, 'push', 'pull'), command.script)
def test_get_new_command(): assert (get_new_command(Command('git branch list')) == shell.and_('git branch --delete list', 'git branch'))
def get_new_command(command): return shell.and_('tsuru login', command.script)
def get_new_command(command): return shell.and_( 'chmod +x {}'.format(command.script_parts[0][2:]), command.script)
def get_new_command(command): path = re.findall(r"touch: cannot touch '(.+)/.+':", command.stderr)[0] return shell.and_(u'mkdir -p {}'.format(path), command.script)
def test_get_new_command(): assert (get_new_command(Command('git branch list')) == shell.and_( 'git branch --delete list', 'git branch'))
def get_new_command(command): repl = shell.and_('mkdir -p \\1', 'cd \\1') return re.sub(r'^cd (.*)', repl, command.script)
def get_new_command(command): packages = get_pkgfile(command.script) formatme = shell.and_('{} -S {}', '{}') return [formatme.format(pacman, package, command.script) for package in packages]
def get_new_command(command): line = command.stderr.split('\n')[-3].strip() branch = line.split(' ')[-1] set_upstream = line.replace('<remote>', 'origin')\ .replace('<branch>', branch) return shell.and_(set_upstream, command.script)
def get_new_command(command): return shell.and_(replace_argument(command.script, 'push', 'pull'), command.script)
def get_new_command(command): formatme = shell.and_('git stash', '{}') return formatme.format(command.script)
def get_new_command(command): return shell.and_('git branch --delete list', 'git branch')