-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·52 lines (44 loc) · 1.18 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
if ! which git > /dev/null; then
echo "git not installed. Install it with your local package manager and try again!"
exit
fi
DIR=~/gpkg
if [[ -d $DIR ]]
then
cd ~/gpkg
git pull
cd ~/gpkg
chmod a+x ~/gpkg/gpkg
cd ~
exit
else
cd ~
git clone https://github.com/AToMiXhawk/gpkg ~/gpkg
case $SHELL in
"$(which bash)")
echo -e "\nif [ -d \"$HOME/gpkg\" ] ; then\nPATH=\"$HOME/gpkg:$PATH\"\nfi" >> ~/.bashrc
#source ~/.bashrc
#echo "Please close and reopen your terminal if the command gpkg doesn't work"
gnome-terminal
exit
exit
;;
"$(which zsh)")
echo -e "\nif [ -d \"$HOME/gpkg\" ] ; then\nPATH=\"$HOME/gpkg:$PATH\"\nfi" >> ~/.zshrc
source ~/.zshrc
echo "Please close and reopen your terminal if the command gpkg doesn't work"
;;
*)
echo "$0 is not supported"
echo "Please add the following to the config file of you terminal manually (eg. ~/.bashrc or ~/.zshrc)"
echo -e "\nif [ -d \"$HOME/gpkg\" ] ; then\nPATH=\"$HOME/gpkg:$PATH\"\nfi"
echo -e "\nand then close and reopen your terminal and check if the command gpkg works"
echo "Contact @atomixhawk (telegram/github) for support"
;;
esac
cd ~/gpkg
chmod a+x ~/gpkg/gpkg
cd ~
exit
fi