Assert the cn update wiring in tests and document the unified update path
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kb7vDj6PHwymeDeSUUk1eX
This commit is contained in:
@@ -121,6 +121,39 @@ revert_mirror=$(grep -m1 '^MIRROR_LINE=' "$ROOT/bin/omarchy-cn-revert" | cut -d'
|
||||
fail "revert MIRROR_LINE drifted from cn/lib/mirror.sh" "$revert_mirror"
|
||||
pass "convert/revert pair: parse, main() guard, ask=4, mirror constant in sync"
|
||||
|
||||
# Update pipeline: cn migrations ride omarchy-migrate, cn update serves both forms
|
||||
bash -n "$ROOT/bin/omarchy-cn-migrate" || fail "omarchy-cn-migrate parses"
|
||||
grep -q '^OMARCHY_PATH="\$OMARCHY_PATH" omarchy-cn-migrate$' "$ROOT/bin/omarchy-migrate" ||
|
||||
fail "omarchy-migrate runs cn migrations (upstream-sync drift)"
|
||||
grep -q 'exec omarchy-update' "$ROOT/bin/omarchy-cn-update" ||
|
||||
fail "omarchy-cn-update serves package installs via omarchy-update"
|
||||
grep -q 'omarchy-cn-migrate ]]' "$ROOT/bin/omarchy-cn-update" ||
|
||||
fail "downgrade guard checks for omarchy-cn-migrate"
|
||||
pass "update pipeline: cn migrate wired into omarchy-migrate, package branch present"
|
||||
|
||||
# cn migrate runner: pending migrations run once, markers skip reruns
|
||||
mig_root=$(mktemp -d)
|
||||
mkdir -p "$mig_root/cn/migrations"
|
||||
printf 'echo ran >> "$HOME/mig-calls"\n' > "$mig_root/cn/migrations/1000000000.sh"
|
||||
OMARCHY_PATH="$mig_root" omarchy-cn-migrate > /dev/null
|
||||
OMARCHY_PATH="$mig_root" omarchy-cn-migrate > /dev/null
|
||||
[[ $(wc -l < "$HOME/mig-calls") -eq 1 ]] || fail "cn migrate marker prevents reruns"
|
||||
rm -rf "$mig_root"
|
||||
pass "omarchy-cn-migrate runs pending migrations once"
|
||||
|
||||
# Every cn command must be executable (the menu launches them directly)
|
||||
nonexec=$(find "$ROOT/bin" -maxdepth 1 \( -name omarchycn -o -name 'omarchy-cn-*' \) ! -perm -u+x)
|
||||
[[ -z $nonexec ]] || fail "non-executable cn commands" "$nonexec"
|
||||
pass "all cn commands carry the executable bit"
|
||||
|
||||
# App catalog and menu install entries stay in sync
|
||||
catalog_ids=$(jq -r '.apps | keys[]' "$ROOT/cn/apps.json" | sort)
|
||||
menu_ids=$(grep -o '"omarchycn\.apps\.[a-z-]*"' "$ROOT/default/omarchy/omarchy-menu.jsonc" |
|
||||
sed 's/.*apps\.//; s/"//' | sort)
|
||||
diff <(printf '%s\n' "$catalog_ids") <(printf '%s\n' "$menu_ids") > /dev/null ||
|
||||
fail "menu app entries drift from cn/apps.json"
|
||||
pass "menu app entries match the catalog"
|
||||
|
||||
# Menu: OmarchyCN entries parse and reference only existing commands
|
||||
node -e '
|
||||
const fs = require("fs");
|
||||
|
||||
Reference in New Issue
Block a user