Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ info() { printf '\033[34m➜ %s\033[0m\n' "$*"; }

[ "$(uname -s)" = "Darwin" ] || abort "omacase only runs on macOS."
[ "$(uname -m)" = "arm64" ] || abort "omacase supports Apple Silicon Macs only."
MACOS_MIN=26
v="$(sw_vers -productVersion 2>/dev/null)"; major="${v%%.*}"
case "$major" in ''|*[!0-9]*) major=0 ;; esac
[ "$major" -ge "$MACOS_MIN" ] || abort "omacase requires macOS $MACOS_MIN or later (detected: ${v:-unknown})."

# 1. Xcode Command Line Tools (provides git + compilers Homebrew needs).
if ! xcode-select -p >/dev/null 2>&1; then
Expand Down
13 changes: 13 additions & 0 deletions lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,22 @@ confirm() { # confirm "Question?" -> 0 if yes
}

# --- environment -------------------------------------------------------------
OMACASE_MACOS_MIN=26

# Pure comparison so tests can feed arbitrary strings. Accepts "26", "26.0",
# "26.6.1"; compares the MAJOR only (Omacase supports a major, not a minor).
_macos_version_supported() {
local major="${1%%.*}"
case "$major" in ''|*[!0-9]*) return 1 ;; esac
[ "$major" -ge "$OMACASE_MACOS_MIN" ]
}

ensure_supported_platform() {
[ "$(uname -s)" = "Darwin" ] || abort "omacase only runs on macOS."
[ "$(uname -m)" = "arm64" ] || abort "omacase supports Apple Silicon Macs only."
local v; v="$(sw_vers -productVersion 2>/dev/null)"
_macos_version_supported "$v" || \
abort "omacase requires macOS $OMACASE_MACOS_MIN or later (detected: ${v:-unknown})."
}

ensure_brew_env() {
Expand Down
4 changes: 4 additions & 0 deletions site/install
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ info() { printf '\033[34m➜ %s\033[0m\n' "$*"; }

[ "$(uname -s)" = "Darwin" ] || abort "omacase only runs on macOS."
[ "$(uname -m)" = "arm64" ] || abort "omacase supports Apple Silicon Macs only."
MACOS_MIN=26
v="$(sw_vers -productVersion 2>/dev/null)"; major="${v%%.*}"
case "$major" in ''|*[!0-9]*) major=0 ;; esac
[ "$major" -ge "$MACOS_MIN" ] || abort "omacase requires macOS $MACOS_MIN or later (detected: ${v:-unknown})."

# 1. Xcode Command Line Tools (provides git + compilers Homebrew needs).
if ! xcode-select -p >/dev/null 2>&1; then
Expand Down
22 changes: 22 additions & 0 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,26 @@ test_bootstrap_copies_are_identical() {
cmp -s "$ROOT/boot.sh" "$ROOT/site/install"
}

test_macos_version_gate_boundaries() {
# shellcheck source=/dev/null
source "$ROOT/lib/common.sh"
_macos_version_supported "26" &&
_macos_version_supported "26.0" &&
_macos_version_supported "26.6.1" &&
_macos_version_supported "27.1" &&
! _macos_version_supported "25.6" &&
! _macos_version_supported "15.5" &&
! _macos_version_supported "" &&
! _macos_version_supported "beta"
}

test_boot_and_runtime_share_macos_minimum() {
# One number, three files — drift here would let bootstrap and runtime disagree.
grep -q 'OMACASE_MACOS_MIN=26' "$ROOT/lib/common.sh" &&
grep -q 'MACOS_MIN=26' "$ROOT/boot.sh" &&
grep -q 'MACOS_MIN=26' "$ROOT/site/install"
}

test_backup_domains_cover_defaults_sh() {
OMACASE_ROOT="$ROOT"
# shellcheck source=/dev/null
Expand Down Expand Up @@ -956,6 +976,8 @@ run_test "herdr is declared in the Brewfile" test_herdr_is_declared_in_brewfile
run_test "herdr agent hooks cover shipped agent CLIs" test_herdr_hooks_cover_shipped_agents
run_test "herdr skill is left to herdr, not managed by omacase" test_herdr_skill_is_not_managed_by_omacase
run_test "site/install matches boot.sh" test_bootstrap_copies_are_identical
run_test "macos version gate accepts 26+ and rejects below" test_macos_version_gate_boundaries
run_test "boot and runtime share the macos 26 minimum" test_boot_and_runtime_share_macos_minimum
run_test "theme manifest lists all themes" test_theme_manifest_lists_all_themes
run_test "OmniWM seed is valid with nine workspaces" test_omniwm_seed_is_valid_and_has_nine_workspaces
run_test "Ghostty windows remain manageable by OmniWM" test_ghostty_windows_remain_manageable
Expand Down