forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add brew-uninstall-application script (raycast#712)
* Update iconsur.sh * Add Brew Uninstall Application * Update iconsur.sh * Update iconsur.sh * Update brew uninstall script
- Loading branch information
1 parent
b075f78
commit ad8c073
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
commands/developer-utils/brew/brew-uninstall-application.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Uninstall | ||
# @raycast.mode compact | ||
|
||
# Optional parameters: | ||
# @raycast.icon 🍺 | ||
# @raycast.argument1 { "type": "text", "placeholder": "Application" } | ||
# @raycast.packageName Brew | ||
|
||
# Documentation: | ||
# @raycast.description Uninstalls an Specified Application Using Homebrew | ||
# @raycast.author StevenRCE0 | ||
# @raycast.authorURL https://github.com/StevenRCE0 | ||
|
||
if ! command -v brew &> /dev/null; then | ||
echo "brew command is required (https://brew.sh)."; | ||
exit 1; | ||
fi | ||
|
||
# Workaround for the error message | ||
exec 2>/dev/null | ||
|
||
brew cat --cask "$1"; | ||
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then | ||
brew cat "$1"; | ||
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then | ||
echo "That's not a cask nor a formula. Check the spelling or try uninstalling it manually."; | ||
exit 2; | ||
fi | ||
echo "brew uninstall --force --zap \"$1\"" | pbcopy; | ||
else | ||
echo "brew uninstall --cask --force --zap \"$1\"" | pbcopy; | ||
fi | ||
|
||
echo "Copied command to clipboard."; |