mirror of
https://github.com/pnpm/pnpm.git
synced 2026-06-28 09:55:39 -04:00
* fix: avoid workspace state parse crashes * fix(workspace-state): write workspace state atomically Port the atomic-write half of the pnpm fix for #12020 to pacquet. pacquet's install/add/update/remove all call update_workspace_state, and the on-disk file is shared with the pnpm CLI, so a non-atomic fs::write could leave a torn file that a concurrent `pnpm run` reads and crashes on. Write to a temp file in the same directory and rename it into place, mirroring pnpm's switch to write-file-atomic. --------- Co-authored-by: Zoltan Kochan <z@kochan.io>