-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·42 lines (34 loc) · 1.1 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
#!/bin/sh
set -e
case "$(uname -s)" in
Darwin*) os=macos;;
Linux*) os=linux;;
*) os=unknown;;
esac
has() {
[ -x "$(command -v "$1")" ]
}
if [ "$os" = macos ]; then
has brew || bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
has git || brew install git
has stow || brew install stow
fi
(
target_dir=~/dotfiles
[ -d "$target_dir" ] || git clone https://github.com/mdwint/dotfiles.git "$target_dir"
cd "$target_dir"
tpm=~/.config/tmux/plugins/tpm
[ -d "$tpm" ] || (mkdir -p "$(dirname "$tpm")" && git clone https://github.com/tmux-plugins/tpm "$tpm")
if [ "$os" = macos ]; then
./macos-defaults.sh
stow -- */
tic -x tmux/.tmux-terminfo.src
brew bundle --no-lock --no-upgrade
brew autoupdate start 43200 --cleanup --immediate
else
stow bin fish git neovim ripgrep tmux
fi
has nvim && nvim --headless '+Lazy! sync' +qa
has pipx && while read -r pkg; do pipx install "$pkg" || true; done <python-packages
)
has rustup || curl https://sh.rustup.rs -sSf | sh