1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00

Suggest brew uninstall --force when relevant

Resolves https://github.com/nvbn/thefuck/issues/553
This commit is contained in:
Joseph Frazier 2016-09-29 17:19:16 -04:00
parent 9660ec7813
commit a734b94fec
2 changed files with 14 additions and 0 deletions

View File

@ -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` &ndash; turns `brew update <formula>` into `brew upgrade <formula>`;
* `brew_upgrade` &ndash; appends `--all` to `brew upgrade` as per Homebrew's new behaviour;

View 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)