mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
Merge pull request #232 from bugaevc/fix-sudo
Wrap apt-get rule in sudo_support
This commit is contained in:
commit
995b373347
@ -1,11 +1,12 @@
|
|||||||
from thefuck import shells
|
from thefuck import shells
|
||||||
|
from thefuck.utils import sudo_support
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import CommandNotFound
|
import CommandNotFound
|
||||||
except ImportError:
|
except ImportError:
|
||||||
enabled_by_default = False
|
enabled_by_default = False
|
||||||
|
|
||||||
|
@sudo_support
|
||||||
def match(command, settings):
|
def match(command, settings):
|
||||||
if 'not found' in command.stderr:
|
if 'not found' in command.stderr:
|
||||||
try:
|
try:
|
||||||
@ -17,7 +18,7 @@ def match(command, settings):
|
|||||||
# IndexError is thrown when no matching package is found
|
# IndexError is thrown when no matching package is found
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@sudo_support
|
||||||
def get_new_command(command, settings):
|
def get_new_command(command, settings):
|
||||||
c = CommandNotFound.CommandNotFound()
|
c = CommandNotFound.CommandNotFound()
|
||||||
pkgs = c.getPackages(command.script.split(" ")[0])
|
pkgs = c.getPackages(command.script.split(" ")[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user