-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·61 lines (50 loc) · 1.13 KB
/
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
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
#!/usr/bin/env bash
pushd `dirname $0` > /dev/null
DOTFILES=`pwd -P`
popd > /dev/null
puts() {
printf "\033[00;34m$@\033[0m\n"
}
doUpdateRepo() {
puts "Updating repository"
git pull origin master
}
doLink() {
ln -s $DOTFILES/.bash ~/.bash
ln -s $DOTFILES/.bash_profile ~/.bash_profile
ln -s $DOTFILES/.bashrc ~/.bashrc
ln -s $DOTFILES/.editorconfig ~/.editorconfig
ln -s $DOTFILES/.gemrc ~/.gemrc
ln -s $DOTFILES/.gitconfig ~/.gitconfig
ln -s $DOTFILES/.gitignore ~/.gitignore
ln -s $DOTFILES/.tmux.conf ~/.tmux.conf
ln -s $DOTFILES/.zshrc ~/.zshrc
}
doInstall() {
puts "Installing helpers"
source "$DOTFILES/installers/asdf.sh"
source "$DOTFILES/installers/asdf-plugins.sh"
source "$DOTFILES/installers/zsh-spaceship.sh"
}
reloadConfig() {
puts "Reloading Config"
git config --global core.excludesfile ~/.gitignore_global
puts "Reloading ZSH"
exec $SHELL
}
doAll() {
doUpdateRepo
doInstall
doLink
}
if [ "$1" == "--link" ]; then
doLink
elif [ "$1" == "--update" ]; then
doUpdateRepo
elif [ "$1" == "--install" ]; then
doInstall
else
doAll
fi
#Always reload the config/shell environment
reloadConfig