Repository navigation
Conversation
omarchy-update-available runs under set -euo pipefail and dereferences $OMARCHY_PATH bare on the check that decides whether the install is package-backed, so any context that never sourced default/bash/rc kills it with "unbound variable" -- a sudo'd update under the default env_reset, or a non-login SSH session. omarchy-update-status calls it near the end of every update, and it exits 1 both when Omarchy is up to date and when it crashes. The status script consumes that in an if, so the crash takes the clear branch and the bar's update indicator is cleared as though the system were current, leaving only a stray unbound-variable line behind. Default the variable the way default/bash/rc, default/bash/env-bootstrap, omarchy-migrate and omarchy-version already do. An unset OMARCHY_PATH now classifies the install as package-backed and skips the dev-checkout check, which is what it means. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Defaults OMARCHY_PATH when checking for updates and adds regression coverage for unset environments.
Changes:
- Adds a package-install fallback for
OMARCHY_PATH. - Tests exit status, output, stderr, and skipped Git operations.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-update-available |
Adds the environment fallback. |
test/shell.d/update-available-test.sh |
Adds unset-variable regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I reviewed this against current What ran on the worker:
Other callers: the bar widget ( For the maintainer:
Second opinion: none. Codex Medium answered the availability check, but the review itself was refused because the day's review budget was spent. This is one model's reading, plus the worker runs above. No |
Fixes #8769.
Problem
omarchy-update-availableruns underset -euo pipefailand dereferences$OMARCHY_PATHbare on line 9, the check that decides whether the install is a dev checkout:Any context that never sourced
default/bash/rcreaches it unset — asudo'd update under the defaultenv_reset, a non-login SSH session:This is the same defect #8369 reports in
omarchy-update-dev, in the sibling script. #8590 fixes onlyomarchy-update-dev, so on thesudo omarchy updatepath it moves the crash rather than removing it: the update clears the dev-checkout step and then hits the identical error here.omarchy-update-statuscalls this near the end of every update, and the failure is silent:omarchy-update-availableexits 1 both when Omarchy is up to date and when it crashes, and theifconsumes that status. The crash therefore takes theclearbranch: the bar's update indicator is cleared as though the system were current, and since only stdout is redirected the sole trace is a strayunbound variableline in the update output.#7398 also touches this file, but rewrites the comparison as
${OMARCHY_PATH%/}— still a bare dereference underset -u— so it does not cover this either. The two changes don't conflict; whichever lands second keeps the default.Fix
The established pattern, already used in
default/bash/rc,default/bash/env-bootstrap,bin/omarchy-migrateandbin/omarchy-version:An unset
OMARCHY_PATHnow classifies the install as package-backed and skips the dev-checkout branch, which is exactly what it means. Dev checkouts with the variable exported are unaffected, and the package/checkupdateshalf of the script never read it.This matches the fallback #8590 adds to
omarchy-update-dev; it is repeated locally here for the same reason given there — the command is reachable standalone from environments that never source Omarchy's shell bootstrap.Testing
Added a case to
test/shell.d/update-available-test.shthat runs the real command withOMARCHY_PATHunset and asserts it exits 1 with the up-to-date message, stays quiet on stderr, and issues nogitcalls (proving it classified the install as package-backed rather than probing a checkout at"").Mutation-checked: reverting the one-line default fails the new case with the exact reported error, and no other case in the file notices.
Also passing:
bin-style-test,update-status-test,update-sequence-test,update-lock-test,./test/cli,bash -non both changed files, andgit diff --check.