Skip to content

fix(update): default OMARCHY_PATH under sudo nounset - #11104

Open
americos wants to merge 2 commits into
omacom:quattrofrom
americos:fix-11065-omarchy-path-sudo
Open

fix(update): default OMARCHY_PATH under sudo nounset#11104
americos wants to merge 2 commits into
omacom:quattrofrom
americos:fix-11065-omarchy-path-sudo

Conversation

@americos

Copy link
Copy Markdown

Summary

  • omarchy-update-dev uses set -u and reads $OMARCHY_PATH before any default.
  • Under sudo omarchy update, that env var is wiped, so the script dies with OMARCHY_PATH: unbound variable.
  • Default unset/empty to /usr/share/omarchy so packaged installs still take the early-exit path.

Fixes #11065

Test plan

  • env -u OMARCHY_PATH bash -c 'set -u; [[ ${OMARCHY_PATH:-/usr/share/omarchy} != /usr/share/omarchy ]] || echo early_exit' → early_exit
  • With OMARCHY_PATH unset, running the script (or the guard line under set -u) no longer unbound-errors
  • With OMARCHY_PATH pointing at a real git checkout that has upstream, update still pulls as before

Under sudo, OMARCHY_PATH is unset and set -u aborts omarchy-update-dev.
Default to /usr/share/omarchy so non-dev installs still early-exit.

Fixes omacom#11065
Mimics sudo wiping the environment so the early-exit default stays covered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-update-dev fails with unbound variable OMARCHY_PATH under sudo

1 participant