forked from matthewmccullough/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_setupdotfiles.zsh
executable file
·73 lines (61 loc) · 1.74 KB
/
_setupdotfiles.zsh
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/zsh
export UNLINK=true
function symlinkifne {
echo "WORKING ON: $1"
# does it exist
if [[ -a $1 ]]; then
echo " WARNING: $1 already exists."
# If Unlink is requested
if [ "$UNLINK" = "true" ]; then
unlink $1
echo " Unlinking $1"
# create the link
export DOTLESS=`echo $1 | sed s/.//`
echo " Symlinking $DOTFILESDIRRELATIVETOHOME/$DOTLESS to $1"
ln -s $DOTFILESDIRRELATIVETOHOME/$DOTLESS $1
else
echo " SKIPPING $1."
fi
# does not exist
else
# create the link
export DOTLESS=`echo $1 | sed s/.//`
echo " Symlinking $DOTFILESDIRRELATIVETOHOME/$DOTLESS to $1"
ln -s $DOTFILESDIRRELATIVETOHOME/$DOTLESS $1
fi
}
echo "This script must be run from the dotfiles directory"
echo "Setting up..."
#export DOTFILESDIRRELATIVETOHOME=$PWD
export DOTFILESDIRRELATIVETOHOME=.dotfiles
echo "DOTFILESDIRRELATIVETOHOME = $DOTFILESDIRRELATIVETOHOME"
pushd ~
symlinkifne .bash_profile
symlinkifne .bashrc
symlinkifne .boom
symlinkifne .boom.conf
symlinkifne .cloudapp
symlinkifne .conf
symlinkifne .gemrc
symlinkifne .gitconfig
symlinkifne .gitignore
symlinkifne .netrc
symlinkifne .profile
symlinkifne .rvmrc
symlinkifne .shellactivities
symlinkifne .shellaliases
symlinkifne .shellpaths
symlinkifne .shellvars
symlinkifne .slate
symlinkifne .vimrc
symlinkifne .zlogout
symlinkifne .zprofile
#symlinkifne .zsh
symlinkifne .zshenv
symlinkifne .zshrc
popd
# Ignore changes to these two files since they are local history
git update-index --assume-unchanged bash_history
git update-index --assume-unchanged zsh_history
git update-index --assume-unchanged zsh-update
git update-index --assume-unchanged zdirstore