Skip to content

Commit

Permalink
Avoid passing config fields as flags for pnpm
Browse files Browse the repository at this point in the history
Matching the behavior with yarn, stop npm-run-all2 from passing fields in the package.json#config field as flags.
  • Loading branch information
bcomnes committed Sep 13, 2024
1 parent bac3905 commit dc2d7da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/run-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@ module.exports = function runTask (task, options) {
}

const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith('yarn')
const isPnpm = Boolean(process.env.PNPM_SCRIPT_SRC_DIR)
const isNpm = !isYarn && !isPnpm

const spawnArgs = ['run']

if (npmPathIsJs) {
spawnArgs.unshift(npmPath)
}
if (!isYarn) {
if (isNpm) {
Array.prototype.push.apply(spawnArgs, options.prefixOptions)
} else if (options.prefixOptions.indexOf('--silent') !== -1) {
spawnArgs.push('--silent')
Expand Down

0 comments on commit dc2d7da

Please # to comment.