#N/A: Cache docker, gem, grunt and yarn output in rules

This commit is contained in:
Vladimir Iakovlev
2017-09-02 10:22:00 +02:00
parent f20e344663
commit bf0867967b
5 changed files with 20 additions and 5 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
import re
from subprocess import Popen, PIPE
from thefuck.utils import for_app, eager, replace_command, replace_argument
from thefuck.utils import (for_app, eager, replace_command, replace_argument,
cache, which)
regex = re.compile(r'error Command "(.*)" not found.')
@@ -28,6 +29,10 @@ def _get_all_tasks():
yield line.split(' ')[-1]
if which('yarn'):
_get_all_tasks = cache(which('yarn'))(_get_all_tasks)
def get_new_command(command):
misspelled_task = regex.findall(command.output)[0]
if misspelled_task in npm_commands: