Skip to content

Commit bb41ef6

Browse files
Add a proper check for yarn
Before, `isYarn` would be false if you ran yarn using `npx`.
1 parent bf91f94 commit bb41ef6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/run-task.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ module.exports = function runTask(task, options) {
157157
const npmPath = options.npmPath || process.env.npm_execpath //eslint-disable-line no-process-env
158158
const npmPathIsJs = typeof npmPath === "string" && /\.m?js/.test(path.extname(npmPath))
159159
const execPath = (npmPathIsJs ? process.execPath : npmPath || "npm")
160-
const isYarn = path.basename(npmPath || "npm").startsWith("yarn")
160+
const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith("yarn") //eslint-disable-line no-process-env
161161
const spawnArgs = ["run"]
162162

163163
if (npmPathIsJs) {

0 commit comments

Comments
 (0)