-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·37 lines (30 loc) · 1.04 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
# gitkit/install.sh
#
# usage: bash install.sh # will prompt user for bash profile path
# bash install.sh ~/.profile # install to the provided bash profile
set -e
cd $(dirname "$0")
echo '//////////////////////////////////////////'
echo ' ___ _ _ _ _ _ '
echo ' / __|(_)| |_ | |__(_)| |_ '
echo '| (_ || || _|| / /| || _|'
echo ' \___||_| \__||_\_\|_| \__| 0.1'
echo
if [ "$#" -eq 1 ]; then
PROFILE_PATH=$1
else
echo -n "Path to your bash profile [leave blank for ~/.profile]: "
read PROFILE_PATH
if [ -z "$PROFILE_PATH" ]; then PROFILE_PATH='~/.profile'; fi
fi
PROFILE_PATH=${PROFILE_PATH/\~/$HOME}
cp gitkit.sh ~/.profile--gitkit.sh
sed -i -E 's/.*gitkit.*//' $PROFILE_PATH
echo >> $PROFILE_PATH
echo "# gitkit" >> $PROFILE_PATH
echo ". ~/.profile--gitkit.sh" >> $PROFILE_PATH
echo "- installed to ~/.profile--gitkit.sh"
echo "- invoked from $PROFILE_PATH"
echo "- start a new terminal session, then run 'gts' :)"
echo
echo '//////////////////////////////////////////'