-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
executable file
·35 lines (32 loc) · 790 Bytes
/
Copy pathinstaller.sh
File metadata and controls
executable file
·35 lines (32 loc) · 790 Bytes
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
33
34
35
#!/usr/bin/env bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
SCRIPT_DIR="$(cd -- "$(dirname "$0")" && pwd)"
name="vcdroid-installer"
install_crystal()
{
echo -e "${YELLOW} $name Installing...${NC}"
if [ ! -f "$SCRIPT_DIR/bin/$name" ]; then
shards build --release -p || { echo "${RED}Build failed${NC}"; exit 1; }
fi
sudo install -m 755 "$SCRIPT_DIR/bin/$name" "/usr/bin/"
echo -e "${GREEN} $name Installed!${NC}"
}
uninstall() {
sudo rm -f "/usr/bin/$name" &> /dev/null
echo -e "${RED} $name Deleted!${NC}"
}
main()
{
if [ "$1" == "install" ]; then
install_crystal
elif [ "$1" == "uninstall" ]; then
uninstall
else
echo -e "${RED} Options $0 { install | uninstall }${NC}"
exit 1
fi
}
main "$@"