fix(exec): exit with the right exit code

This commit is contained in:
Zoltan Kochan
2021-05-28 03:17:53 +03:00
parent ff2ba03e31
commit a77a2005e5
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-script-runners": patch
---
`pnpm exec` should exit with the exit code of the child process and should not print an error.

View File

@@ -121,6 +121,9 @@ export async function handler (
})
result.passes++
} catch (err) {
if (!opts.recursive && typeof err.exitCode === 'number') {
process.exit(err.exitCode)
}
logger.info(err)
if (!opts.bail) {