-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·51 lines (46 loc) · 1.62 KB
/
setup.sh
File metadata and controls
executable file
·51 lines (46 loc) · 1.62 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
#!/usr/bin/env bash
# setup.sh — One-shot macOS setup orchestrator
#
# Usage:
# ./setup.sh Run everything
# ./setup.sh install Install packages only
# ./setup.sh link Create symlinks only
# ./setup.sh config Configure git and runtimes only
# ./setup.sh macos Apply macOS settings only
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if command -v brew &> /dev/null; then
eval "$(brew shellenv)"
else
echo "Homebrew is not available yet — the install step will set it up."
fi
run_step() {
local label="$1"
local script="$2"
echo ""
echo "=== ${label} ==="
if ! bash "${DIR}/${script}"; then
echo "ERROR: ${script} failed. Fix the issue and re-run: ./setup.sh ${3:-}"
exit 1
fi
}
case "${1:-all}" in
install) run_step "Installing packages" "install.sh" "install" ;;
link) run_step "Creating symlinks" "link.sh" "link" ;;
config) run_step "Configuring git and runtimes" "config.sh" "config" ;;
macos) run_step "Applying macOS settings" "macos.sh" "macos" ;;
all)
run_step "Installing packages" "install.sh" "install"
run_step "Creating symlinks" "link.sh" "link"
run_step "Configuring git and runtimes" "config.sh" "config"
run_step "Applying macOS settings" "macos.sh" "macos"
echo ""
echo "=== All done ==="
echo "Some changes require a logout or restart to take effect."
echo "See README.md for manual configuration steps."
;;
*)
echo "Usage: ./setup.sh [install|link|config|macos]"
exit 1
;;
esac