Created
July 27, 2023 08:54
-
-
Save spookyuser/c3cf304d8330123232bb58057b9f8883 to your computer and use it in GitHub Desktop.
Brew uninstall !! for fish !! yay !!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function brew | |
if test (count $argv) -gt 0 | |
if test $argv[1] = "install" | |
/opt/homebrew/bin/brew $argv | |
if test $status -eq 0 | |
echo $argv[2..-1] > /tmp/.brew_last_installed | |
end | |
return | |
else if test $argv[1] = "uninstall" -a $argv[2] = "!!" | |
if test -f /tmp/.brew_last_installed | |
set last_package (cat /tmp/.brew_last_installed) | |
/opt/homebrew/bin/brew uninstall $last_package | |
if test $status -eq 0 | |
echo "Package" $last_package "has been uninstalled." | |
rm /tmp/.brew_last_installed | |
end | |
else | |
echo "No record of the last installed package." | |
end | |
return | |
end | |
end | |
/opt/homebrew/bin/brew $argv | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment