-
Notifications
You must be signed in to change notification settings - Fork 3
/
chromebrew
executable file
·32 lines (32 loc) · 940 Bytes
/
chromebrew
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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