1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-26 20:48:47 +00:00
thefuck/thefuck/rules/vagrant_up.py
2015-11-15 18:02:37 +01:00

21 lines
514 B
Python

from thefuck import shells
from thefuck.utils import for_app
@for_app('vagrant')
def match(command):
return 'run `vagrant up`' in command.stderr.lower()
def get_new_command(command):
cmds = command.script_parts
machine = None
if len(cmds) >= 3:
machine = cmds[2]
startAllInstances = shells.and_("vagrant up", command.script)
if machine is None:
return startAllInstances
else:
return [shells.and_("vagrant up " + machine, command.script), startAllInstances]