fix(config): preserve symlinked ~/.config/aube/config.toml on write#605
Conversation
`aube config set/delete` wrote into a sibling temp and renamed it over the path, which replaced a symlinked config.toml with a regular file. Follow the symlink target before atomic_write, matching the fix #517 applied to ~/.npmrc. Closes #603 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR fixes
Confidence Score: 5/5Safe to merge — a narrow, well-tested fix that adds no new code paths beyond what already exists for npmrc. The change is a two-line fix with a direct regression test. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(config): preserve symlinked ~/.confi..." | Re-trigger Greptile |
Summary
aube config set/deletewrote into a sibling temp file and renamed it over the path, which replaced a symlinked~/.config/aube/config.tomlwith a regular fileatomic_write, mirroring the fix #517 shipped for~/.npmrcsymlink_target_or_selfaspub(crate)innpmrc.rssoaube_config.rscan reuse it without duplicatingCloses #603.
Test plan
cargo test -p aube commands::config::aube_config— newsave_preserves_symlinktest passescargo test -p aube commands::npmrc::tests::save_preserves_symlink— existing npmrc symlink test still passescargo clippy -p aube --all-targets -- -D warningscargo fmt --check🤖 Generated with Claude Code
Note
Low Risk
Low risk: narrowly changes the write path resolution for
aube configsaves and adds a Unix-only regression test; behavior for non-symlink paths should remain unchanged.Overview
aube configwrites now preserve a symlinked~/.config/aube/config.tomlby resolvingpathto its symlink target before callingatomic_write, avoiding replacing the symlink with a regular file during rename-based atomic saves.The existing
npmrchelpersymlink_target_or_selfis madepub(crate)for reuse, and a Unix-only test is added to assert symlink preservation and correct content updates.Reviewed by Cursor Bugbot for commit 99215e3. Bugbot is set up for automated code reviews on this repo. Configure here.