-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstaller.sh
executable file
·47 lines (41 loc) · 1.2 KB
/
installer.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
# installing required libraries
pip install . -r requirements.txt
## installing at loc
CATERPATH="~/"
echo "Installing CaterApp in home directory ($HOME)..."
mkdir ~/CaterApp
mv ./* ~/CaterApp/
## setting start command
callAlias="alias cater-app=\"python ~/CaterApp/caterapp/cater.py\""
CATERHEADER="# >>> CaterApp command >>>"
CATERFOOTER="# <<< CaterApp command <<<"
if ls -a ~ | grep -q .bashrc
then
if ! cat ~/.bashrc | grep -q 'CaterApp command'
then
echo >> ~/.bashrc
echo $CATERHEADER >> ~/.bashrc
echo "# !! auto generated alias for CaterApp" >> ~/.bashrc
echo $callAlias >> ~/.bashrc
echo "$CATERFOOTER" >> ~/.bashrc
printf "\n\n" >> ~/.bashrc
source ~/.bashrc
fi
else
echo "bash is not installed"
fi
if ls -a ~ | grep -q .zshrc
then
if ! cat ~/.zshrc | grep -q 'CaterApp command'
then
echo $CATERHEADER >> ~/.zshrc
echo "# !! auto generated alias for CaterApp" >> ~/.zshrc
echo $callAlias >> ~/.zshrc
echo "$CATERFOOTER" >> ~/.zshrc
printf "\n\n" >> ~/.zshrc
fi
else
echo "zsh is not installed"
fi
echo "-------------------"
printf "\nUse 'cater-app' to use the application\n\n"