diff --git a/thefuck/rules/goenv_no_such_command.py b/thefuck/rules/goenv_no_such_command.py index 41434e2d..ec57a399 100644 --- a/thefuck/rules/goenv_no_such_command.py +++ b/thefuck/rules/goenv_no_such_command.py @@ -1,5 +1,5 @@ import re -from thefuck.utils import for_app, replace_argument, replace_command +from thefuck.utils import cache, for_app, replace_argument, replace_command, which from thefuck.specific.devenv import env_available, COMMON_TYPOS, get_commands enabled_by_default = env_available @@ -10,6 +10,10 @@ def match(command): return 'goenv: no such command' in command.output +if which('goenv'): + get_commands = cache(which('goenv'))(get_commands) + + @for_app('goenv') def get_new_command(command): broken = re.findall(r"goenv: no such command '([^']*)'", command.output)[0] diff --git a/thefuck/rules/nodenv_no_such_command.py b/thefuck/rules/nodenv_no_such_command.py index 935c2698..d260a761 100644 --- a/thefuck/rules/nodenv_no_such_command.py +++ b/thefuck/rules/nodenv_no_such_command.py @@ -1,5 +1,5 @@ import re -from thefuck.utils import for_app, replace_argument, replace_command +from thefuck.utils import cache, for_app, replace_argument, replace_command, which from thefuck.specific.devenv import env_available, COMMON_TYPOS, get_commands enabled_by_default = env_available @@ -10,6 +10,10 @@ def match(command): return 'nodenv: no such command' in command.output +if which('nodenv'): + get_commands = cache(which('nodenv'))(get_commands) + + @for_app('nodenv') def get_new_command(command): broken = re.findall(r"nodenv: no such command `([^']*)'", command.output)[0] diff --git a/thefuck/rules/pyenv_no_such_command.py b/thefuck/rules/pyenv_no_such_command.py index 9bcb2778..9466b5ef 100644 --- a/thefuck/rules/pyenv_no_such_command.py +++ b/thefuck/rules/pyenv_no_such_command.py @@ -1,5 +1,5 @@ import re -from thefuck.utils import for_app, replace_argument, replace_command +from thefuck.utils import cache, for_app, replace_argument, replace_command, which from thefuck.specific.devenv import env_available, COMMON_TYPOS, get_commands enabled_by_default = env_available @@ -10,6 +10,10 @@ def match(command): return 'pyenv: no such command' in command.output +if which('pyenv'): + get_commands = cache(which('pyenv'))(get_commands) + + @for_app('pyenv') def get_new_command(command): broken = re.findall(r"pyenv: no such command `([^']*)'", command.output)[0] diff --git a/thefuck/rules/rbenv_no_such_command.py b/thefuck/rules/rbenv_no_such_command.py index e56cb064..6481d7d4 100644 --- a/thefuck/rules/rbenv_no_such_command.py +++ b/thefuck/rules/rbenv_no_such_command.py @@ -1,5 +1,5 @@ import re -from thefuck.utils import for_app, replace_argument, replace_command +from thefuck.utils import cache, for_app, replace_argument, replace_command, which from thefuck.specific.devenv import env_available, COMMON_TYPOS, get_commands enabled_by_default = env_available @@ -10,6 +10,10 @@ def match(command): return 'rbenv: no such command' in command.output +if which('rbenv'): + get_commands = cache(which('rbenv'))(get_commands) + + @for_app('rbenv') def get_new_command(command): broken = re.findall(r"rbenv: no such command `([^']*)'", command.output)[0]