mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 04:18:55 +00:00
Fix sudo after npm errors
This commit is contained in:
parent
b1c21d5a08
commit
173a4300b4
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
|
||||
setup(name='thefuck',
|
||||
version=1.1,
|
||||
version=1.2,
|
||||
description="Magnificent app which corrects your previous console command",
|
||||
author='Vladimir Iakovlev',
|
||||
author_email='nvbn.rm@gmail.com',
|
||||
|
@ -5,6 +5,7 @@ from thefuck.rules.sudo import match, get_new_command
|
||||
def test_match():
|
||||
assert match(Command('', '', 'Permission denied'))
|
||||
assert match(Command('', '', 'permission denied'))
|
||||
assert match(Command('', '', "npm ERR! Error: EACCES, unlink"))
|
||||
assert not match(Command('', '', ''))
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
def match(command):
|
||||
return 'permission denied' in command.stderr.lower()
|
||||
return ('permission denied' in command.stderr.lower()
|
||||
or 'EACCES' in command.stderr)
|
||||
|
||||
|
||||
def get_new_command(command):
|
||||
|
Loading…
x
Reference in New Issue
Block a user