-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace uninstall script with chromebrew
- Loading branch information
1 parent
b9b5abe
commit e590e0a
Showing
3 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
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
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,32 @@ | ||
#!/bin/bash | ||
VALID= | ||
if test $1; then | ||
OPTS="-i --install -r --remove -u --update" | ||
for o in $OPTS; do | ||
if [ $o == $1 ]; then | ||
VALID=1 | ||
break | ||
fi | ||
done | ||
fi | ||
if [ -z "$VALID" ]; then | ||
echo "Usage: chromebrew -i | --install | -r | --remove | -u | --update" | ||
exit 1 | ||
fi | ||
if [[ $1 == "-i" || $1 == "--install" ]]; then | ||
command -v crew > /dev/null && { echo "chromebrew is currently installed."; exit 1; } | ||
rm -f install.sh | ||
curl -Ls git.io/vddgY -o install.sh && yes | bash install.sh | ||
else | ||
command -v crew > /dev/null || { echo "chromebrew is not installed. To install, execute 'chromebrew -i | --install'."; exit 1; } | ||
fi | ||
if [[ $1 == "-r" || $1 == "--remove" ]]; then | ||
echo -n "WARNING! Are you sure you want to uninstall crew? [y/N]: "; read -n1 UNINSTALL | ||
if [ "$UNINSTALL" == "y" ]; then | ||
sudo dev_install --reinstall -y | ||
fi | ||
fi | ||
if [[ $1 == "-u" || $1 == "--update" ]]; then | ||
crew update | ||
yes | crew upgrade | ||
fi |