-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-macos
More file actions
executable file
·49 lines (39 loc) · 1.35 KB
/
setup-macos
File metadata and controls
executable file
·49 lines (39 loc) · 1.35 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
#!/usr/bin/env bash
# Setup script for macOS (Apple Silicon only) — modernized for yadm + zoxide
set -euo pipefail
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Install Homebrew if not already installed
if ! command_exists brew; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Homebrew already installed, updating..."
brew update
fi
# Activate Homebrew in current session and .zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/opt/homebrew/bin/brew shellenv)"
# Install/update formulae
echo "Installing/updating formulae from brew.formula..."
xargs brew install < brew.formula || true
# Install/update casks
echo "Installing/updating casks from brew.casks..."
xargs brew install --cask < brew.casks || true
# Homebrew autoupdate (force restart if stuck)
if ! brew tap | grep -q "homebrew/autoupdate"; then
brew tap homebrew/autoupdate
fi
brew autoupdate delete 2>/dev/null || true
brew autoupdate start
# instrumenta tap (if still needed)
if ! brew tap | grep -q "instrumenta/instrumenta"; then
brew tap instrumenta/instrumenta
fi
# Create local bin
mkdir -p "$HOME/.local/bin"
# Execute generic setup
echo "Executing generic setup script..."
exec ./setup-generic