-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.sh
25 lines (24 loc) · 953 Bytes
/
setup.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
#!/bin/sh
if [ $1 > 0 ] ; then
if [ $1 = 'uninstall' ]; then
cp ~/.bashrc .bashrc-copy
grep -Ev hippos .bashrc-copy > ~/.bashrc
rm .bashrc-copy
echo "PyPLIF HIPPOS has been successfully uninstalled"
echo "PyPLIF HIPPOS will not be able to run the next time"
echo "you open new terminal"
else
echo "$1 command is not recognized"
fi
else
sourcedir=`pwd`
cp ~/.bashrc ~/.bashrc-ori
grep -Ev hippos ~/.bashrc-ori > ~/.bashrc
echo "alias hippos='$sourcedir/src/pyplif_hippos/hippos.py'" >> ~/.bashrc
echo "alias hippos-genref='$sourcedir/src/pyplif_hippos/hippos_genref.py'" >> ~/.bashrc
chmod u+x $sourcedir/src/pyplif_hippos/hippos.py
chmod u+x $sourcedir/src/pyplif_hippos/hippos_genref.py
echo "PyPLIF HIPPOS is ready for service"
echo "To use PyPLIF HIPPOS, you have to open new terminal or"
echo "run 'source ~/.bashrc' in this terminal."
fi