-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·120 lines (95 loc) · 2.12 KB
/
install.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
#Setup script for Dotfiles
CWD=$(pwd)
arg=$1
function install_OhMyZsh {
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
}
function install_Brew {
/usr/local/bin/brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install $(< brew-packages)
brew cask install $(< brew-cask-packages)
# To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install
}
function install_Vundle {
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +'PlugInstall --sync' +qa
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --all
}
function backup {
mv -iv ~/$1 ~/$1.old
}
function symlink {
ln -sfnv $CWD/$1 ~/$1
}
function updateDotfile {
echo -e "Backing up $1"
backup $1
echo -e "Adding symlinks ~/$1"
symlink $1
}
function install_Scripts {
FILES=$CWD/scripts/*
for f in $FILES
do
ln -sfnv $f /usr/local/bin/$(basename $f)
done
}
function install_PowerlineFont {
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts
}
echo -e "Setting up Dotfiles..."
if [[ "$arg" == "-i" || "$arg" == "--install" ]]; then
echo -e "Select an option:"
echo -e " 1) for Oh-My-Zsh"
echo -e " 2) for brew install packages"
echo -e " 3) for Vundle"
echo -e " 4) for Scripts"
echo -e " 5) for all"
echo -e " 0) to Exit"
read option
case $option in
"1")echo -e "Installing Oh-My-Zsh..."
install_OhMyZsh
install_PowerlineFont
;;
"2")echo -e "Installing Brew packages..."
install_Brew
;;
"3")echo -e "Installing Vundle..."
install_Vundle
;;
"4")echo -e "Installing scripts..."
install_Scripts
;;
"5")echo -e "Installing everything..."
install_PowerlineFont
install_Brew
install_OhMyZsh
install_Vundle
install_Scripts
;;
"0")echo -e "Bye"
exit 0
;;
*)echo -e "Invalid option entered."
exit 1
;;
esac
exit 0
fi
updateDotfile .fzf.zsh
updateDotfile .zshrc
updateDotfile .vimrc
updateDotfile .tmux.conf
echo -e "Done."