mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-30 10:38:13 -05:00
fix: fix the state.json creation path when execute pnpm patch in sub package (#9733)
--------- Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
6
.changeset/nasty-deer-check.md
Normal file
6
.changeset/nasty-deer-check.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"pnpm": patch
|
||||
"@pnpm/plugin-commands-patching": patch
|
||||
---
|
||||
|
||||
Fix `state.json` creation path when executing `pnpm patch` in a workspace project [#9733](https://github.com/pnpm/pnpm/pull/9733).
|
||||
@@ -101,7 +101,7 @@ export async function handler (opts: PatchCommandOptions, params: string[]): Pro
|
||||
|
||||
writeEditDirState({
|
||||
editDir,
|
||||
modulesDir: path.join(opts.dir, opts.modulesDir ?? 'node_modules'),
|
||||
modulesDir,
|
||||
patchedPkg: params[0],
|
||||
applyToAll: patchedDep.applyToAll,
|
||||
})
|
||||
|
||||
@@ -60,7 +60,7 @@ export async function handler (opts: PatchCommitCommandOptions, params: string[]
|
||||
const editDir = path.resolve(opts.dir, userDir)
|
||||
const stateValue = readEditDirState({
|
||||
editDir,
|
||||
modulesDir: path.join(opts.dir, opts.modulesDir ?? 'node_modules'),
|
||||
modulesDir: path.join(lockfileDir, opts.modulesDir ?? 'node_modules'),
|
||||
})
|
||||
if (!stateValue) {
|
||||
throw new PnpmError('INVALID_PATCH_DIR', `${userDir} is not a valid patch directory`, {
|
||||
|
||||
Reference in New Issue
Block a user