fix(theme): establish OMARCHY_PATH in entry points for non-interactive shells - #9103
Open
harshithnadig wants to merge 1 commit into
Open
fix(theme): establish OMARCHY_PATH in entry points for non-interactive shells#9103harshithnadig wants to merge 1 commit into
harshithnadig wants to merge 1 commit into
Conversation
…e shells 'omarchy theme list' and 'omarchy theme set' depended on OMARCHY_PATH being exported in the caller's environment. Because OMARCHY_PATH was only exported in '~/.bashrc' via 'env-bootstrap', non-interactive shells (cron, SSH, scripts, CI, systemd) evaluated OMARCHY_PATH as empty, causing 'theme list' to query '/themes/' (failing silently with exit 0) and 'theme set' to report that existing themes do not exist. Establish OMARCHY_PATH in 'bin/omarchy', 'bin/omarchy-theme-list', and 'bin/omarchy-theme-set' if unset, falling back to '/etc/omarchy.conf' and '/usr/share/omarchy'. Also exit non-zero if the themes directory cannot be found. Fixes omacom#9065
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.
Problem
In #9065,
omarchy theme listandomarchy theme setfail in non-interactive environments (scripts, cron, SSH, CI, AI agents) because$OMARCHY_PATHis only exported by~/.bashrcin interactive login sessions.When
$OMARCHY_PATHis unset:omarchy theme listqueries/themes/, outputs a find error to stderr, and silently exits0with an empty list.omarchy theme set <name>queries/themes/<name>and falsely reports that the theme does not exist.Solution
bin/omarchy(the root entry dispatcher), establishOMARCHY_PATHif unset before executing sub-commands.bin/omarchy-theme-listandbin/omarchy-theme-set, check and fallbackOMARCHY_PATHfrom/etc/omarchy.confor/usr/share/omarchy.bin/omarchy-theme-list, exit with code1if neither system nor user theme directories exist.Fixes #9065