forked from rtregaskis/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
executable file
·35 lines (30 loc) · 968 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
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# need to document
HERE=$(pwd)
echo 'Setting up dotfiles...'
BASHRC=~/.bashrc
ALIASES=~/.bash_aliases
PROFILE=~/.bash_profile
LIQUIDPROMPT=~/.liquidpromptrc
GITCONFIG=~/.gitconfig
GITMESSAGE=~/.gitmessage
GITIGNOREGLOBAL=~/.gitignore_global
WITHFORCE=''
if [[ $* == *--force* ]]; then
WITHFORCE='-f'
fi
if [ -f "$BASHRC" ] || [ -f "$ALIASES" ] || [ -f "$PROFILE" ] || [ -f "$LIQUIDPROMPT" ] || [ -f "$GITCONFIG" ] ||
[ -f "$GITMESSAGE" ] || [ -f "$GITIGNOREGLOBAL" ] && [[ $* != *--force* ]]
then
echo "Symlinked file(s) already exists"
echo "Run this script with --force if you are feeling brave.."
exit -1
fi
ln -s $WITHFORCE $HERE/bashrc $BASHRC
ln -s $WITHFORCE $HERE/aliases.sh $ALIASES
ln -s $WITHFORCE $HERE/profile $PROFILE
ln -s $WITHFORCE $HERE/liquidpromptrc $LIQUIDPROMPT
ln -s $WITHFORCE $HERE/gitconfig $GITCONFIG
ln -s $WITHFORCE $HERE/gitmessage $GITMESSAGE
ln -s $WITHFORCE $HERE/gitignore_global $GITIGNOREGLOBAL
echo 'Done'