mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 01:28:56 +00:00
Fixed errors from suggested changes
This commit is contained in:
parent
e8e2f59ee1
commit
e7782119fe
@ -1,4 +1,4 @@
|
|||||||
from thefuck.utils import for_app
|
from thefuck.utils import for_app, which
|
||||||
|
|
||||||
|
|
||||||
@for_app("choco", "cinst")
|
@for_app("choco", "cinst")
|
||||||
@ -10,20 +10,20 @@ def match(command):
|
|||||||
def get_new_command(command):
|
def get_new_command(command):
|
||||||
# Find the argument that is the package name
|
# Find the argument that is the package name
|
||||||
for script_part in command.script_parts:
|
for script_part in command.script_parts:
|
||||||
if "choco" in i:
|
if "choco" in script_part:
|
||||||
continue
|
continue
|
||||||
if "cinst" in i:
|
if "cinst" in script_part:
|
||||||
continue
|
continue
|
||||||
if "install" in i:
|
if "install" in script_part:
|
||||||
continue
|
continue
|
||||||
if i.startswith('-'): # Some parameters start with hyphens; some packages contain them though
|
if script_part.startswith('-'): # Some parameters start with hyphens; some packages contain them though
|
||||||
continue
|
continue
|
||||||
if '=' in i: # Some paramaters contain '='
|
if '=' in script_part: # Some paramaters contain '='
|
||||||
continue
|
continue
|
||||||
if '/' in i: # Some parameters contain slashes
|
if '/' in script_part: # Some parameters contain slashes
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
packageName = i
|
packageName = script_part
|
||||||
# Find the name of the broken package, and append metapackage names
|
# Find the name of the broken package, and append metapackage names
|
||||||
if not packageName:
|
if not packageName:
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user