#N/A: Cache docker, gem, grunt and yarn output in rules
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user