-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·55 lines (47 loc) · 1.51 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
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#TODO:
# dotfile clean
# dotfile update
# configure nvim
# maybe allow overriding this with parameter
DOT_DIR="$HOME/.dotfiles"
mv $(dirname $(readlink -f $0)) $DOT_DIR > /dev/null 2>&1
cd $DOT_DIR
mkdir -p $HOME/.shell
if [ ! -f $HOME/.shell/profile ] ; then
echo "--- creating profile ---"
echo "export DOT_DIR=$DOT_DIR" > $HOME/.shell/profile
echo 'source $DOT_DIR/shell/profile' >> $HOME/.shell/profile
fi
echo " --- configuring shell ---"
# if shell files exist already, move them and create new symlinks
for file in $(ls sources); do
if [ ! -h $HOME/.$file ]; then
if [ -f $HOME/.$file ]; then
echo ".$file exists - moving to .${file}_original"
mv $HOME/.$file $HOME/.${file}_original
fi
fi
ln -sf ${DOT_DIR}/sources/$file $HOME/.$file
echo "created symlink for $file"
done
#for shell in $SHELLS; do
# if [ ! -h $HOME/.${shell}rc ]; then
# if [ -f $HOME/.${shell}rc ]; then
# echo ".${shell}rc exists - moving to .${shell}rc_original"
# mv $HOME/.${shell}rc $HOME/.${shell}rc_original
# fi
# fi
# ln -sf $DOT_DIR/${shell}/${shell}rc $HOME/.${shell}rc
# echo "created symlink for ${shell}rc"
#done
echo " --- configuring git ---"
git config --global --add user.name "Austin Kim"
git config --global --add core.excludesfile $DOT_DIR/git/gitignore_global
git config --global --add include.path $DOT_DIR/git/gitconfig
#TODO this doesn't change much or ever
echo " --- configuring vim ---"
if [ ! -e $HOME/.vim ]; then
ln -sf $DOT_DIR/vim $HOME/.vim
fi
echo " --- done ---"