-
Notifications
You must be signed in to change notification settings - Fork 4
/
INSTALL.sh
executable file
·35 lines (27 loc) · 1012 Bytes
/
INSTALL.sh
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 sh
if [ "$(tput colors)" -gt 2 ]; then
RED="\033[1;31m"
RESET="\033[0m"
else
RED=""
RESET=""
fi
error() {
echo "${RED}Error: $1${RESET}"
echo "Please report this at \
https://github.com/shellrhythm/shellrhythm-cli/issues if necessary."
exit 1
}
cd ~/.local/
echo "Downloading shellrhythm to ~/.local/..."
git clone https://github.com/HastagGuigui/shellrhythm.git --depth=1
[ $? -ne 0 ] && error "Failed to download shellrhythm from GitHub"
cd ./shellrhythm
echo "Installing required python dependencies... (there's like 3)"
python3 -m pip install -r requirements.txt
[ $? -ne 0 ] && error "Failed to download python dependencies"
echo "Linking ~/.local/shellrhythm/shellrhythm to ~/.local/bin/shellrhythm..."
ln -s ~/.local/shellrhythm/shellrhythm ~/.local/bin/shellrhythm
[ $? -ne 0 ] && error "Failed to create symbolic link"
echo "Successfully installed! You can now run the shellrhythm command to begin."
echo "(If the command is not recognised, restart your terminal.)"