Repository navigation
fix(init): preserve settings.json symlink during atomic write - #2088
Conversation
7c206e6 to
6fc6ad0
Compare
|
@aeppling may I ask you to review this PR, this has been in the list for long and would help many user if it could be integrated into rtk. Thank you for your great work and for your time reviewing this PR. |
atomic_write() replaced symlinked settings.json with a regular file. Now resolves symlink targets before the tempfile+rename so the link itself is preserved and the real file gets updated. Covers both absolute and relative symlink targets. Closes rtk-ai#653
6fc6ad0 to
cf7e5fd
Compare
|
Hi, thanks for your contribution! |
Simplify resolve_atomic_target() per review feedback — fs::canonicalize handles chained symlinks, relative paths, and all edge cases. Co-authored-by: Roopesh <roopesh1724989@gmail.com>
|
Thanks @KuSh for the review! Both items addressed:
All tests green: |
Summary
atomic_write()replaced symlinkedsettings.jsonwith a regular file, breaking setups that symlink config files (e.g. dotfile managers, multi-machine sync)Closes #653
Supersedes #675 — rebased on current develop. The portable hook path change from #675 is no longer needed since the codebase moved from shell scripts to
rtk hook claudebinary command.Changes Made
resolve_atomic_target()that detects symlinks and resolves to their target (absolute or relative)atomic_write()to write through to the resolved targetTesting
cargo fmt --all --checkcargo clippy --all-targets— no warningscargo test --all— 1942 passed, 6 ignoredcargo test init::tests::test_atomic_writeChecklist