Skip to content

Commit dc2d7da

Browse files
committed
Avoid passing config fields as flags for pnpm
Matching the behavior with yarn, stop npm-run-all2 from passing fields in the package.json#config field as flags.
1 parent bac3905 commit dc2d7da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/run-task.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,15 @@ module.exports = function runTask (task, options) {
192192
}
193193

194194
const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith('yarn')
195+
const isPnpm = Boolean(process.env.PNPM_SCRIPT_SRC_DIR)
196+
const isNpm = !isYarn && !isPnpm
195197

196198
const spawnArgs = ['run']
197199

198200
if (npmPathIsJs) {
199201
spawnArgs.unshift(npmPath)
200202
}
201-
if (!isYarn) {
203+
if (isNpm) {
202204
Array.prototype.push.apply(spawnArgs, options.prefixOptions)
203205
} else if (options.prefixOptions.indexOf('--silent') !== -1) {
204206
spawnArgs.push('--silent')

0 commit comments

Comments
 (0)