fix(exec): look for the executed command in the current dir first

This commit is contained in:
Zoltan Kochan
2022-01-23 02:00:56 +02:00
parent d90e668421
commit 9c0f7e69ab
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/plugin-commands-script-runners": patch
"pnpm": patch
---
`pnpm exec` should look for the executed command in the `node_modules/.bin` directory that is relative to the current working directory. Only after that should it look for the executable in the workspace root.

View File

@@ -125,8 +125,8 @@ export async function handler (
...process.env,
...extraEnv,
[PATH]: [
...opts.extraBinPaths,
path.join(opts.dir, 'node_modules/.bin'),
...opts.extraBinPaths,
process.env[PATH],
].join(path.delimiter),
PNPM_PACKAGE_NAME: opts.selectedProjectsGraph?.[prefix]?.package.manifest.name,