-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall
executable file
·44 lines (37 loc) · 1.33 KB
/
install
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
function _usage {
cat << _USAGE_
`basename $0` [-hb]
-h help (you are here)
-b <ext> backup files with the given extension
_USAGE_
}
bak=false
while getopts hb: opt ; do
case $opt in
h) _usage && exit 0 ;;
b) [ -n "$OPTARG" ] && bak="$OPTARG" ;;
?|*) _usage && exit 2;;
esac
done
shift $(($OPTIND-1))
pushd `dirname $0` > /dev/null
b=$(pwd -P)
popd > /dev/null
mkdir -p $HOME/.vim
if [ $bak != false ]; then
for f in .bashrc .inputrc .psqlrc .vimrc .gitignore .lein/profiles.clj; do
[ -f $HOME/$f ] && cp $HOME/$f $HOME/$f.$bak
done
{ test -d $HOME/.vim/colors && mv $HOME/.vim/colors $HOME/.vim/colors.bak; }
fi
mkdir -p $HOME/.lein
{ rm -f $HOME/.git-completion.bash; ln -s $b/git-completion.bash $HOME/.git-completion.bash; }
{ rm -f $HOME/.bashrc; ln -s $b/bashrc $HOME/.bashrc; }
{ rm -f $HOME/.inputrc; ln -s $b/inputrc $HOME/.inputrc; }
{ rm -f $HOME/.psqlrc; ln -s $b/psqlrc $HOME/.psqlrc; }
{ rm -f $HOME/.vimrc; ln -s $b/vi/vimrc $HOME/.vimrc; }
{ rm -f $HOME/.vimrc; ln -s $b/vi/vimrc $HOME/.ideavimrc; }
{ rm -f $HOME/.hushlogin; ln -s $b/hushlogin $HOME/.hushlogin; }
{ rm -f $HOME/.gitignore; ln -s $b/.gitignore $HOME/.gitignore; }
{ rm -f $HOME/.lein/profiles.clj; ln -s $b/profiles.clj $HOME/.lein/profiles.clj; }
{ rm -rf $HOME/.vim/colors; ln -s $b/vi/colors $HOME/.vim/colors; }