1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 20:11:17 +00:00

Merge branch 'juzim-apt_get_not_installed'

This commit is contained in:
Vladimir Iakovlev 2017-01-30 13:06:34 +01:00
commit 28a0150e45
2 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,8 @@ from tests.utils import Command
(Command(script='vim', stderr='vim: command not found'),
[('vim', 'main'), ('vim-tiny', 'main')]),
(Command(script='sudo vim', stderr='vim: command not found'),
[('vim', 'main'), ('vim-tiny', 'main')]),
(Command(script='vim', stderr="The program 'vim' is currently not installed. You can install it by typing: sudo apt install vim"),
[('vim', 'main'), ('vim-tiny', 'main')])])
def test_match(mocker, command, packages):
mocker.patch('thefuck.rules.apt_get.which', return_value=None)

View File

@ -29,7 +29,7 @@ def get_package(executable):
def match(command):
if 'not found' in command.stderr:
if 'not found' in command.stderr or 'not installed' in command.stderr:
executable = _get_executable(command)
return not which(executable) and get_package(executable)
else: