Repository navigation
Keep omarchy-mise-install from deleting files it did not write - #14539
omarchybot wants to merge 1 commit into
Conversation
Updates rerun every mise install through omarchy-refresh-applications, and the installer removed whatever sat at ~/.local/bin/<command> before writing its wrapper, so a user's own wrapper or binary at gh, claude or any of the other names was deleted with no backup. Replace only a symlink or a wrapper Omarchy wrote, matched byte for byte against each form the generator has had, and leave anything else with a note. Fixes #7101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
|
Heads up: #11484 ("Preserve custom launchers when installing mise wrappers") and #13243 ("Stop mise-install from clobbering a user's own wrapper") are both still open for the same problem (#7101). This version's whole-file match against every historical wrapper form looks like the most careful of the three, but it's worth consolidating so |
|
I moved Codex and Claude Code to their native installers. Both put a symlink at |
|
I compared this pull request with the two older open fixes for #7101: #11484 and #13243. All three stop The oldest fix wins by default, unless a newer one handles a case the older one misses. This one doesn't, and #11484 handles two cases this one gets wrong at dd8ee5f:
This branch also exits 0 when a directory or FIFO is in the way, which leaves no command and reports success. #11484 and #13243 both fail in that case. I found nothing here that #11484 lacks: it already compares whole files as bytes. All three conflict with Codex Medium gave the second opinion. I didn't tell it which fix I preferred, and it picked #11484 for the same reasons. It found the directory and FIFO case on its own. Independence is not guaranteed, because it can read this session's transcript. This waits on the maintainer to pick between the three fixes and to decide what |
omarchy updatedeletes files a user keeps in~/.local/binunder the names Omarchy installs mise wrappers for:claude,codex,gh,copilot,opencode,grok,hey,basecampand the rest ofinstall/user/mise.sh. Migration1786183928runsomarchy-refresh-applications, which rerunsinstall/user/mise.sh, andomarchy-mise-installremoved whatever was at each path before writing its wrapper. A hand-written wrapper that pins a version or points a tool at a proxy was replaced without a prompt or a backup, and snapper's defaultrootconfig does not cover/home.omarchy-provision-user,omarchy-install-preinstallsandomarchy-upgrade-to-quattroreach the same code.omarchy-mise-installnow replaces the path only when it is empty, a symlink, or a wrapper Omarchy wrote. A symlink is still unlinked rather than written through, as #6619 chose, so its target is untouched. A wrapper counts as Omarchy's only when the whole file matches, byte for byte, one of the five forms the generator has written, with the package and binary as plain double-quoted words. That is the same test migration1787573629uses to decide which wrappers to regenerate. Anything else, including an Omarchy wrapper someone added a line to, is left in place with a note on stderr. The installer still exits 0 in that case, so an update carries on.On a worker built from the Omarchy ISO, with a user's own
claudeandghwrappers and an old-form Omarchycodexwrapper in a throwawayHOME, migration1786183928replaced all three onquattro. With this change it leaves the two user files as they were and still movescodexto the current form. The new cases intest/shell.d/mise-install-test.shfail onquattroand pass here. Codex at medium effort reviewed the change over four rounds. It found that an earlier line-by-line match accepted edited wrappers, and that reading the file into a variable hid NUL bytes. Both are fixed here, and its last round found nothing.Fixes #7101