-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·64 lines (47 loc) · 1.79 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
#!/usr/bin/env bash
command_exists() {
type "$1" > /dev/null 2>&1
}
echo "Installing dotfiles."
echo "Initializing submodule(s)"
git submodule update --init --recursive
source install/link.sh
# only perform macOS-specific install
if [ "$(uname)" == "Darwin" ]; then
echo -e "\n\nRunning on OSX"
source install/brew.sh
source install/osx.sh
# create a backup of the original nginx.conf
if [ -f /usr/local/etc/nginx/nginx.conf ]; then
mv /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf.original
fi
ln -s ~/.dotfiles/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf
# symlink the code.dev from dotfiles
ln -s ~/.dotfiles/nginx/code.dev /usr/local/etc/nginx/sites-enabled/code.dev
fi
# only perform Linux-specific install
if [ "$(uname)" == "Linux" ]; then
echo -e "\n\nRunning on Linux"
# keyboard key swap for Linux on Mac - ` and §
ln -s ~/.dotfiles/linux/.Xmodmap ~/.Xmodmap
fi
echo "updating terminal information for TMUX"
source install/fix-terminfo.sh
echo "creating vim directories"
mkdir -p ~/.vim-tmp
if ! command_exists zsh; then
echo "zsh not found. Please install and then re-run installation scripts"
exit 1
elif ! [[ $SHELL =~ .*zsh.* ]]; then
echo "Configuring zsh as default shell"
chsh -s $(which zsh)
fi
# if ! command_exists zplug; then
# echo "installing zplug, a plugin manager for zsh - http://zplug.sh"
# git clone https://github.com/zplug/zplug ~/.zplug
# fi
if ! command_exists zplugin; then
echo "installing zplugin, Elastic Zsh plugin manager with clean fpath, reports, completion management, turbo mode, services - https://github.com/zdharma/zplugin"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zplugin/master/doc/install.sh)"
fi
echo "Done. Reload your terminal."