1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-20 20:09:07 +00:00

Wrap apt-get rule in sudo_support

Fixes sudo_support not working for no_command rule.
This commit is contained in:
Sergey Bugaev 2015-05-30 19:40:01 +03:00
parent 3194913965
commit dbe1a94c7d

View File

@ -1,11 +1,12 @@
from thefuck import shells
from thefuck.utils import sudo_support
try:
import CommandNotFound
except ImportError:
enabled_by_default = False
@sudo_support
def match(command, settings):
if 'not found' in command.stderr:
try:
@ -17,7 +18,7 @@ def match(command, settings):
# IndexError is thrown when no matching package is found
return False
@sudo_support
def get_new_command(command, settings):
c = CommandNotFound.CommandNotFound()
pkgs = c.getPackages(command.script.split(" ")[0])