-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
28 lines (24 loc) · 848 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
#!/bin/bash
# Use directory bgf is stored in
DIRECTORY=~/bgf
# Specify user that will have bgf installed for
USER=
# If you use another alias file name for whatever reason, you can change it here
ALIAS_FILE=.bash_aliases
if [ ~/.bash_aliases ] ; then
echo -e "\n# bgf" >> ~/${ALIAS_FILE} ;
echo -e "alias bgf='${DIRECTORY}/main.sh'\n" >> ~/${ALIAS_FILE} ;
echo "source ${DIRECTORY}/bgf_completion.bash" >> ~/.bashrc
chmod -R 777 ${DIRECTORY}
chown -R ${USER} ${DIRECTORY}
chgrp -R ${USER} ${DIRECTORY}
elif [ ! ~/.bash_aliases ] ; then
touch ~/${ALIAS_FILE} ;
echo -e "\n# bgf" >> ~/${ALIAS_FILE} ;
echo -e "alias bgf='${DIRECTORY}/main.sh'\n" >> ~/${ALIAS_FILE} ;
echo "source ${DIRECTORY}/bgf_completion.bash" >> ~/.bashrc
chmod -R 777 ${DIRECTORY}
chown -R ${USER} ${DIRECTORY}
chgrp -R ${USER} ${DIRECTORY}
fi
source ~/.bashrc