-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
68 lines (61 loc) · 2.67 KB
/
Copy pathsetup.sh
File metadata and controls
68 lines (61 loc) · 2.67 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
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
#!/usr/bin/env bash
################################################################################
# SETUP
#
# Bootstraps a fresh macOS machine by sourcing modular setup scripts from the
# setup/ directory. Each script handles one concern:
#
# brew.sh — Homebrew and Brewfile packages
# claude.sh — Claude Code config into ~/.claude/
# git.sh — Machine-specific git identity and signing keys
# symlinks.sh — Dotfiles and shell functions into ~/
# vscode.sh — VS Code config symlinks and tracked extensions
# macos.sh — Default shell and macOS preferences
# hosts.sh — Syncs /etc/hosts with the repo copy
################################################################################
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# config.sh holds machine/identity details (git identity, 1Password refs) and is
# gitignored, so it never exists on a fresh clone. Require it up front rather than
# letting later steps skip silently.
if [ ! -f "$SCRIPT_DIR/config.sh" ]; then
echo ""
echo "══════════════════════════════════════"
echo " ⛔ Missing config.sh"
echo "══════════════════════════════════════"
echo ""
echo " setup needs a config.sh before it can run. Create one with either:"
echo ""
echo " cp config.sh.example config.sh # then edit the values"
echo " make plugin DIR=<path> # if a plugin provides one"
echo ""
exit 1
fi
# Collected by the sourced setup scripts and reported at the end.
SETUP_WARNINGS=()
source "$SCRIPT_DIR/setup/brew.sh"
source "$SCRIPT_DIR/setup/claude.sh"
source "$SCRIPT_DIR/setup/git.sh"
source "$SCRIPT_DIR/setup/symlinks.sh"
source "$SCRIPT_DIR/setup/vscode.sh"
source "$SCRIPT_DIR/setup/macos.sh"
source "$SCRIPT_DIR/setup/hosts.sh"
echo ""
echo ""
echo "══════════════════════════════════════"
echo " ✅ All done!"
echo "══════════════════════════════════════"
echo ""
echo " Switch identity: mode work | mode home"
echo " Check identity: mode status"
echo ""
if [ "${#SETUP_WARNINGS[@]}" -gt 0 ]; then
echo "══════════════════════════════════════"
echo " ⚠️ Needs attention"
echo "══════════════════════════════════════"
echo ""
for _w in "${SETUP_WARNINGS[@]}"; do
echo " - $_w"
done
echo ""
fi
exec zsh