-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bash
executable file
·62 lines (50 loc) · 1.33 KB
/
install.bash
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
#!/usr/bin/env bash
install_nvim() {
NVIM_PLUG_PATH=$HOME/.config/nvim/autoload
NVIM_PLUG_FILE=$NVIM_PLUG_PATH/plug.vim
if [[ ! -d "$NVIM_PLUG_PATH" ]]; then
mkdir -p $HOME/.config/nvim/autoload
fi
if [[ ! -f "$NVIM_PLUG_FILE" ]]; then
echo "installing neovim plug"
sh -c "curl -fLo $NVIM_PLUG_FILE --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
fi
}
install_brew() {
if [[ "$OSTYPE" != "darwin"* ]]; then
return 0
fi
if hash brew 2> /dev/null; then
return 0;
fi
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
}
install_node() {
if hash node 2> /dev/null; then
return 0
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install node
elif [[ "$OSTYPE" == "linux"* ]]; then
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
fi
}
main() {
mkdir -p $HOME/.ssh
install_brew
install_node
install_nvim
stow -v -t $HOME \
alacritty \
emacs \
git \
gnupg \
nvim \
psql \
ssh \
tmux \
zshrc
}
main || exit 1