mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
Suggest brew uninstall --force
when relevant
Resolves https://github.com/nvbn/thefuck/issues/553
This commit is contained in:
parent
9660ec7813
commit
a734b94fec
@ -238,6 +238,7 @@ Enabled by default only on specific platforms:
|
||||
* `apt_get_search` – changes trying to search using `apt-get` with searching using `apt-cache`;
|
||||
* `apt_invalid_operation` – fixes invalid `apt` and `apt-get` calls, like `apt-get isntall vim`;
|
||||
* `brew_install` – fixes formula name for `brew install`;
|
||||
* `brew_uninstall` – adds `--force` to `brew uninstall` if multiple versions were installed;
|
||||
* `brew_unknown_command` – fixes wrong brew commands, for example `brew docto/brew doctor`;
|
||||
* `brew_update_formula` – turns `brew update <formula>` into `brew upgrade <formula>`;
|
||||
* `brew_upgrade` – appends `--all` to `brew upgrade` as per Homebrew's new behaviour;
|
||||
|
13
thefuck/rules/brew_uninstall.py
Normal file
13
thefuck/rules/brew_uninstall.py
Normal file
@ -0,0 +1,13 @@
|
||||
from thefuck.utils import for_app
|
||||
|
||||
|
||||
@for_app('brew', at_least=2)
|
||||
def match(command):
|
||||
return (command.script_parts[1] in ['uninstall', 'rm', 'remove']
|
||||
and "brew uninstall --force" in command.stdout)
|
||||
|
||||
|
||||
def get_new_command(command):
|
||||
command.script_parts[1] = 'uninstall'
|
||||
command.script_parts.insert(2, '--force')
|
||||
return ' '.join(command.script_parts)
|
Loading…
x
Reference in New Issue
Block a user