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:
1 parent
c9b6b40117
commit
6633eb3eb0
3 files changed
+8
-2
No files matched your search
@@ -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