-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·38 lines (28 loc) · 1.68 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·38 lines (28 loc) · 1.68 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/sh
# install.sh — bootstrap dotfiles on a new machine
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/mutecipher/dotfiles/main/install.sh | sh
#
# What it does:
# 1. Checks that git is available
# 2. Clones (or updates) the repo to ~/.dotfiles
# 3. Runs setup.sh to create all symlinks
set -e
DOTFILES="${DOTFILES:-$HOME/.dotfiles}"
REPO="https://github.com/mutecipher/dotfiles.git"
# ── helpers ───────────────────────────────────────────────────────────────────
info() { printf '\033[0;34m=>\033[0m %s\n' "$*"; }
die() { printf '\033[0;31mError:\033[0m %s\n' "$*" >&2; exit 1; }
# ── preflight ─────────────────────────────────────────────────────────────────
command -v git > /dev/null 2>&1 || die "git is required but not installed."
# ── clone or update ───────────────────────────────────────────────────────────
if [ -d "$DOTFILES/.git" ]; then
info "Dotfiles already present at $DOTFILES, pulling latest..."
git -C "$DOTFILES" pull --ff-only
else
info "Cloning dotfiles to $DOTFILES..."
git clone --depth 1 "$REPO" "$DOTFILES"
fi
# ── run setup ─────────────────────────────────────────────────────────────────
sh "$DOTFILES/setup.sh"