-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
41 lines (34 loc) · 1.17 KB
/
Copy pathinstall.sh
File metadata and controls
41 lines (34 loc) · 1.17 KB
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
#!/usr/bin/env bash
set -e
## ── Detect OS ────────────────────────────────
OS="$(uname -s)"
install_packages() {
if [[ "$OS" == "Darwin" ]]; then
if ! command -v brew &>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install neovim git ripgrep fd node stow tmux
elif [[ "$OS" == "Linux" ]]; then
sudo apt update
sudo apt install -y neovim git ripgrep fd-find nodejs npm stow tmux
fi
}
setup_dotfiles() {
local DOTFILES="$HOME/dotfiles"
if [[ ! -d "$DOTFILES" ]]; then
git clone git@github.com:phuquocchamp/dotfiles.git "$DOTFILES"
fi
for pkg in nvim tmux; do
if [[ -d "$DOTFILES/$pkg" ]]; then
echo "Stowing $pkg..."
stow --dir="$DOTFILES" --restow "$pkg"
fi
done
}
## ── Run ──────────────────────────────────────
echo "Installing dependencies..."
install_packages
echo "Setting up dotfiles..."
setup_dotfiles
echo "Done! Run 'nvim' to start."
echo "lazy.nvim will auto-install plugins on first launch."