Skip to content

Commit da913f9

Browse files
authoredNov 9, 2022
Merge pull request #94 from MarmadileManteater/runjs-being-called-instead-of-npm-run
2 parents 5fb0c9f + 0224167 commit da913f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lib/run-task.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ module.exports = function runTask(task, options) {
153153
}
154154

155155
// Execute.
156-
const npmPath = options.npmPath || process.env.npm_execpath //eslint-disable-line no-process-env
156+
const npmPath = options.npmPath || process.env.NPM_CLI_JS || process.env.npm_execpath //eslint-disable-line no-process-env
157157
const npmPathIsJs = typeof npmPath === "string" && /\.m?js/.test(path.extname(npmPath))
158158
const execPath = (npmPathIsJs ? process.execPath : npmPath || "npm")
159-
const isYarn = path.basename(npmPath || "npm").startsWith("yarn")
159+
const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith("yarn") //eslint-disable-line no-process-env
160160
const spawnArgs = ["run"]
161161

162162
if (npmPathIsJs) {

0 commit comments

Comments
 (0)
Please sign in to comment.