1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 06:38:32 +00:00

Update thefuck/rules/omnienv_no_such_command.py

Co-authored-by: Divy Jain <dkj@somaiya.edu>
This commit is contained in:
Pablo Aguiar 2021-02-10 22:31:15 +01:00 committed by GitHub
parent c23bbbe7b9
commit 34c1e41a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,10 +25,11 @@ def get_app_commands(app):
def get_new_command(command):
app = command.script_parts[0]
app_commands = cache(which(app))(get_app_commands)(app)
broken = re.findall(r"env: no such command ['`]([^']*)'", command.output)[0]
matched = [replace_argument(command.script, broken, common_typo)
for common_typo in COMMON_TYPOS.get(broken, [])]
app = command.script_parts[0]
app_commands = cache(which(app))(get_app_commands)(app)
matched.extend(replace_command(command, broken, app_commands))
return matched