Skip to content

Commit beaac79

Browse files
committed
Always refresn editablePkgJson in fix
1 parent ec33790 commit beaac79

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/commands/fix/pnpm-fix.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ export async function pnpmFix(
158158
? 'root'
159159
: path.relative(rootPath, path.dirname(pkgJsonPath))
160160

161-
const editablePkgJson = isWorkspaceRoot
162-
? pkgEnvDetails.editablePkgJson
163-
: // eslint-disable-next-line no-await-in-loop
164-
await readPackageJson(pkgJsonPath, { editable: true })
161+
// Always re-read the editable package.json to avoid stale mutations across iterations
162+
// eslint-disable-next-line no-await-in-loop
163+
const editablePkgJson = await readPackageJson(pkgJsonPath, {
164+
editable: true
165+
})
165166

166167
// Get current overrides for revert logic
167168
const oldPnpmSection = editablePkgJson.content[PNPM] as

0 commit comments

Comments
 (0)