-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap-common.sh
executable file
·63 lines (53 loc) · 1.57 KB
/
bootstrap-common.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
#!/bin/bash
green=$(tput setaf 2)
red=$(tput setaf 3)
bold=$(tput bold)
normal=$(tput sgr0)
function green {
echo "${bold}${green}${*}${normal}"
}
function red {
echo "${bold}${red}${*}${normal}"
}
function install_homeshick {
if [ ! -d ~/.homesick/repos/homeshick ]; then
green "Installing homeshick: Dotfiles manager"
git clone -q http://github.com/andsens/homeshick.git ~/.homesick/repos/homeshick
fi
PATH=$PATH:$HOME/.homesick/repos/homeshick/bin
[ -d ~/.homesick/repos/dotfiles ] || homeshick clone git@github.com:adamdicarlo/dotfiles
[ -d ~/.homesick/repos/castle-neovim ] || homeshick clone git@github.com:adamdicarlo/castle-neovim
homeshick link dotfiles
homeshick link castle-neovim
}
function install_fnm {
if [ ! -d "$HOME/.config/fnm" ]; then
green "Installing fnm: Fast Node version manager"
curl -fsSL https://fnm.vercel.app/install | bash -s -- \
--install-dir "$HOME/.config/fnm" \
--skip-shell
fi
}
function install_shell {
if [[ "$SHELL" != "/usr/bin/zsh" && "$SHELL" != "/bin/zsh" ]]; then
if which zsh 2>/dev/null; then
green "Updating login shell to zsh"
chsh -s $(which zsh)
else
red "Unable to determine path of zsh"
fi
fi
}
function install_zplug {
ZPLUG_HOME=$HOME/.config/zplug
if [ ! -d $ZPLUG_HOME ]; then
green "Installing zplug: Zsh plugin manager"
curl -sL --proto-redir -all,https \
https://raw.githubusercontent.com/zplug/installer/master/installer.zsh \
| ZPLUG_HOME=$ZPLUG_HOME zsh
fi
}
install_shell
install_homeshick
install_fnm
install_zplug