Repository navigation
Resolve theme display names to on-disk directories and reject unknown themes - #19485
ThePrimeagen wants to merge 4 commits into
Conversation
… missing-arg help Normalize omarchy-theme-dir's argument the same way omarchy-theme-set does (strip markup, lowercase, spaces to dashes), reject invalid names, and only print a theme directory that exists in the user or shipped themes path, exiting 1 with an error on stderr otherwise. Make the omarchy dispatcher return 1 after printing help for a command invoked without its required arguments, in both dispatch paths, so a missing <theme-name> is a usage error instead of success.
[Medium impact] The PR appears safe to merge; no outstanding defects were found. Summary
Reviews (3) · Last reviewed commit: "Keep the omarchy-theme-dir tests that gu..." · Reviewed by Greptile |
|
I read the theme-directory lookup, its Plymouth callers, CLI dispatch, and the existing review comments at Checked by GPT-6 High in Codex. No second code review was requested because classification did not complete. |
|
I read the updated theme-directory lookup and CLI tests at Checked by GPT-6 High in Codex. No second code review was requested because classification did not complete. |
omarchy-theme-set strips tags because menu labels can carry them. Every caller of omarchy-theme-dir passes a folder name from find or a name typed on the command line, so the strip fixed nothing here and made a folder with angle brackets in its name unfindable. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: Muse Wonder High <noreply@meta.com>
The plymouth-list check repeated the exact-folder check through a caller, the user-copy check repeated the display-name one, and "." and "../evil" took the same path as "..". What stays is one check per branch of the lookup, each of which fails when that branch is taken out. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: Muse Wonder High <noreply@meta.com>
|
Reviewed by Claude Fable 5.2 at The bug is real on quattro: This is not the resolver #18795 was closed over. It is the same two steps #18557 gave I pushed two small commits:
Exiting 1 for an unknown theme changes what the command promises, so I followed all five callers ( Second opinion: Opus 5.5 High and muse-wonder (thinking high) each read it twice. They found no defect, both called the markup strip and half the tests surplus, which is what the two commits remove, and both said that failing for an unknown name is the maintainer's call rather than part of the bug. Their independence from this review is not guaranteed. Both also noted that user-copy-before-bundled is untested at this head, as it is on quattro. Classification is unsettled at this head, so it carries no class label. The lookup half fixes a bug; a third model, asked after the two commits above, called the pull request an enhancement, and failing for an unknown name is a change in behaviour rather than a repair. They could be two pull requests, and the first would be about six lines. Greptile scores this head 5/5 and its two earlier findings are answered in their threads. This now waits on the maintainer, for whether |
Running
omarchy theme dir "Tokyo Night"prints/usr/share/omarchy/themes/Tokyo Nightand exits 0, but that directory does not exist andlsof it fails. The real directory is/usr/share/omarchy/themes/tokyo-night, andbin/omarchy-theme-diruses the name verbatim instead of resolving it to that slug.Screenshots
Reproduce
omarchy theme dir "Tokyo Night"; echo DIR_EXIT:$?; ls "$(omarchy theme dir "Tokyo Night")"and press Enter./usr/share/omarchy/themes/Tokyo NightwithDIR_EXIT:0, andlsfails withNo such file or directory (os error 2).More cases
Bogus theme prints a non-existent path and succeeds
No argument prints usage but exits 0
Related
omarchy theme listshows, includingomarchy-theme-dir