1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-04-15 15:20:42 +01:00
thefuck/thefuck/rules/yarn_command_replaced.py
Russ Panula 900e83e028 add rule for: yarn install [pkg]
--- `install` has been replaced with `add` to add new dependencies. Run $0 instead.

6e9a9a6596/src/reporters/lang/en.js (L18)
2017-03-28 18:31:01 +02:00

14 lines
255 B
Python

import re
from thefuck.utils import for_app
regex = re.compile(r'Run "(.*)" instead')
@for_app('yarn', at_least=1)
def match(command):
return regex.findall(command.stderr)
def get_new_command(command):
return regex.findall(command.stderr)[0]