-
Notifications
You must be signed in to change notification settings - Fork 3
/
deploy.sh
executable file
·102 lines (101 loc) · 2.46 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
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
#!/bin/bash
# vim:foldmethod=marker
# Preamble {{{
set -e
SCRIPT_DIR=$(cd `dirname $0` && pwd)
ON_A_MAC=`([ $( uname ) == "Darwin" ] && echo "true") || echo "false"`
source $SCRIPT_DIR/common.sh
# }}}
# Requirements test {{{
test_required_commands zsh curl git tmux rsync cmake
# }}}
# bin dir {{{
export PATH=~/.local/bin:~/.cargo/bin:/usr/local/bin:/usr/bin:$PATH:~/bin
# }}}
# oh my zsh {{{
if ! [ -d ~/.oh-my-zsh ]; then
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
ln -sv $SCRIPT_DIR/lscolors.zsh ~/.oh-my-zsh/custom
else
echo "Skipping oh-my-zsh."
fi
# }}}
# rust/cargo {{{
if ! [ -x "$(command -v cargo)" ]; then
curl https://sh.rustup.rs -sSf | sh
else
echo "Skipping rust/cargo."
fi
# }}}
# ripgrep {{{
if ! [ -x "$(command -v rg)" ]; then
cargo install ripgrep
else
echo "Skipping ripgrep."
fi
if ! [ -e ~/.config/starship.toml ]; then
mkdir -p ~/.config/
ln -sv $SCRIPT_DIR/starship.toml ~/.config
else
echo "Skipping starship config."
fi
# }}}
# starship {{{
if ! [ -x "$(command -v starship)" ]; then
cargo install starship
else
echo "Skipping starship."
fi
# }}}
# dotfiles {{{
for i in $SCRIPT_DIR/.*; do
if [[ $i =~ \.git ]] || [[ $i == "$SCRIPT_DIR/." ]] || [[ $i == "$SCRIPT_DIR/.." ]]; then
continue
fi;
ensure_link $i
done
# }}}
# tmux {{{
if ! [ -d ~/.tmux ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
# }}}
# htop config {{{
HTOP_PATH=$HOME/.config/htop/
if ! [ -f $HTOP_PATH/htoprc -o -L $HTOP_PATH/htoprc ]; then
mkdir -pv $HTOP_PATH
ln -s $SCRIPT_DIR/htoprc $HTOP_PATH
else
echo "Skipping htproc."
fi;
# }}}
# vim/nvim {{{
if ! [ -x "$(command -v nvim)" ]; then
mkdir -pv $HOME/.config/nvim/
if [ $ON_A_MAC == "true" ]; then
bash<<-EOF
cd $(mktemp -d)
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
tar xf nvim-macos.tar.gz
rsync -avz ./nvim-macos/ ~/.local/
EOF
else
bash<<-EOF
cd $(mktemp -d)
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage --appimage-extract
rsync -avz ./squashfs-root/usr/ ~/.local/
EOF
fi
else
echo "Skipping nvim installation."
fi
if ! [ -e ~/.config/nvim/init.lua ]; then
mkdir -p ~/.config/nvim
ln -sv $SCRIPT_DIR/init.lua ~/.config/nvim
else
echo "Skipping nvim config."
fi
# }}}
echo "Done."