Files
thefuck/thefuck/rules/react_native_command_unrecognized.py
T
2016-08-13 19:14:55 +03:00

15 lines
456 B
Python

import re
from thefuck.utils import for_app, replace_command
@for_app('react-native')
def match(command):
return re.match(r'Command `.*` unrecognized', command.stderr)
def get_new_command(command):
misspelled_command = re.findall(r'Command `(.*)` unrecognized',
command.stderr)[0]
commands = re.findall(r' - (.*): .*\n', command.stdout)
return replace_command(command, misspelled_command, commands)