Skip to content

Commit c2d8e74

Browse files
committed
improves install.sh: arg handling + bin files are now optional
1 parent 5f6ca4d commit c2d8e74

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

install.sh

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
#!/bin/sh
2+
#
3+
# Copyright (c) 2015
4+
# Author: Victor Arribas <[email protected]>
5+
# License: GPLv3 <http://www.gnu.org/licenses/gpl-3.0.html>
6+
#
7+
# Usage: ./install.sh [-f] [-bin]
8+
9+
10+
for arg in "$@"; do
11+
case $arg in
12+
'-f')
13+
force_install=$arg
14+
;;
15+
'-bin')
16+
install_bin=$arg
17+
;;
18+
esac
19+
done
220

321

422
link_file(){
@@ -21,7 +39,6 @@ if [ $? -eq 0 ]; then
2139
fi
2240
}
2341

24-
force_install=$1
2542

2643
# install gitconfig
2744
name=.gitconfig
@@ -32,7 +49,11 @@ name=.gitignore_global
3249
link_file $name $force_install
3350
git config --global core.excludesfile \~/$name
3451

35-
# add git extensions to PATH
52+
53+
# add git extensions
54+
if test -n "$install_bin"; then
55+
echo "installing git-extensions (PATH injection)"
56+
3657
declare_path(){
3758
echo ""
3859
echo ""
@@ -46,3 +67,5 @@ elif test -e $HOME/.bashrc; then
4667
else
4768
echo "git-extensions could not be installed">&2
4869
fi
70+
71+
fi # install_bin

0 commit comments

Comments
 (0)