-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·38 lines (32 loc) · 1.02 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·38 lines (32 loc) · 1.02 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
#!/bin/bash
set -euo pipefail
REPO="https://github.com/gabrhsilva/dotfiles.git"
DEST="$HOME/.dotfiles"
echo ""
echo "┌────────────────────────────────┐"
echo "│ dotfiles bootstrap │"
echo "└────────────────────────────────┘"
echo ""
# Install git if missing
if ! command -v git >/dev/null 2>&1; then
echo "→ Installing git..."
if command -v pacman >/dev/null 2>&1; then
sudo pacman -S --noconfirm git
elif command -v apt-get >/dev/null 2>&1; then
sudo apt-get install -y git
elif command -v dnf >/dev/null 2>&1; then
sudo dnf install -y git
else
echo "✗ Instale git manualmente e re-execute"; exit 1
fi
fi
# Clone or update
if [ -d "$DEST/.git" ]; then
echo "→ Updating existing dotfiles..."
git -C "$DEST" pull
else
echo "→ Cloning dotfiles into $DEST..."
git clone "$REPO" "$DEST"
fi
echo "→ Running install.sh..."
bash "$DEST/install.sh"