-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-linux.sh
31 lines (31 loc) · 1.11 KB
/
install-linux.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
curl -s https://raw.githubusercontent.com/Sid-Sun/codeMKII/master/codeMK2.c > codeMK2.c
read -r -p "Which compiler do you want to use? [gcc/clang] " response
if [[ "$response" =~ ^([gG][cC][cC]|[gG])+$ ]]
then
gcc -o codeMK2 codeMK2.c
else
clang -o codeMK2 codeMK2.c
fi
read -r -p "Would you like to install codeMKII system-wide (requires superuser privilages)? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
sudo mkdir -P /usr/share/codeMKII
sudo mv codeMK2 /usr/share/codeMKII/.
sudo chmod 755 /usr/share/codeMKII/codeMK2
sudo chown root:root /usr/share/codeMKII/codeMK2
sudo ln -s /usr/share/codeMKII/codeMK2 /usr/bin/codeMK2
echo "Installed codeMK2 system-wide."
else
mkdir -p ~/.local/share/codeMKII
mv codeMK2 ~/.local/share/codeMKII/.
chmod 755 ~/.local/share/codeMKII/codeMK2
echo "alias codeMK2='~/.local/share/codeMKII/codeMK2'" >> ~/.bashrc
source ~/.bashrc
echo "Installed codeMKII for "$USER"."
fi
read -r -p "Do you want to delete the source code now? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]
then
rm -f codeMK2.c
fi
echo "Enjoy!"