-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
68 lines (59 loc) · 2.65 KB
/
deploy.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
#!/bin/bash
function command_exists() {
if hash $1 2>/dev/null; then
echo "${1} found. Continuing."
else
echo "Command ${1} not found. Exiting."
exit 1;
fi
}
function deploy_configuration() {
echo "Checking whether Git is installed."
command_exists git
echo "Fetching the configuration files from GitHub"
git clone --recursive https://github.com/Quintasan/conf.git ${HOME}/conf
cd ${HOME}/conf
echo "Setting origin to use SSH key"
git remote set-url origin [email protected]:Quintasan/conf.git
echo "Symlinking ${HOME}/conf/zshrc to ${HOME}/.zshrc"
ln -fs ${HOME}/conf/zshrc ${HOME}/.zshrc
mkdir -p ${HOME}/conf/oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
mkdir -p ${HOME}/conf/oh-my-zsh/custom/themes
git clone https://github.com/denysdovhan/spaceship-prompt.git ${HOME}/conf/oh-my-zsh/custom/themes/spaceship-prompt
ln -fs ${HOME}/conf/oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme ${HOME}/conf/oh-my-zsh/custom/themes/spaceship.zsh-theme
echo "Symlinking ${HOME}/conf/tmux.conf to ${HOME}/.tmux.conf"
ln -fs ${HOME}/conf/tmux.conf ${HOME}/.tmux.conf
echo "Setting up tmux"
mkdir -p ${HOME}/.tmux/plugins/
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "Configuring NeoVim..."
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config/nvim}
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
ln -fs ${HOME}/conf/init.vim ${HOME}/.config/nvim/init.vim
echo "Run nvim +PlugInstall +qall before starting NeoVim"
echo "Symlinking ${HOME}/conf/gitconfig to ${HOME}/.gitconfig"
ln -fs ${HOME}/conf/gitconfig ${HOME}/.gitconfig
echo "Symlinking ${HOME}/conf/gitignore_global to ${HOME}/.gitignore_global"
ln -fs ${HOME}/conf/gitignore_global ${HOME}/.gitignore_global
echo "Symlinking ${HOME}/conf/gemrc to ${HOME}/.gemrc"
ln -fs ${HOME}/conf/gemrc ${HOME}/.gemrc
echo "Symlinking ${HOME}/conf/pryrc to ${HOME}/.pryrc"
ln -fs ${HOME}/conf/pryrc ${HOME}/.pryrc
echo "Symlinking ${HOME}/conf/ssh/config to ${HOME}/.ssh/config"
mkdir -p ${HOME}/.ssh
mkdir -p ${HOME}/.ssh/multiplex
ln -fs ${HOME}/conf/ssh/config ${HOME}/.ssh/config
}
echo "Would you to like to deploy the configuration files to ${HOME} (y/n)? "
read ANSWER
if [ $ANSWER == "y" ]
then
echo "Deploying configuration files to ${HOME}..."
deploy_configuration
else
echo "Not doing anything. Exiting"
exit
fi