fix(update): default OMARCHY_PATH under sudo nounset - #11104
Open
americos wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
omarchy-update-devusesset -uand reads$OMARCHY_PATHbefore any default.sudo omarchy update, that env var is wiped, so the script dies withOMARCHY_PATH: unbound variable./usr/share/omarchyso 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_exitOMARCHY_PATHunset, running the script (or the guard line underset -u) no longer unbound-errorsOMARCHY_PATHpointing at a real git checkout that has upstream, update still pulls as before