Skip to content

Commit

Permalink
Add a proper check for yarn
Browse files Browse the repository at this point in the history
Before, `isYarn` would be false if you ran yarn using `npx`.
  • Loading branch information
MarmadileManteater committed Oct 28, 2022
1 parent bf91f94 commit bb41ef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/run-task.js
Expand Up @@ -157,7 +157,7 @@ module.exports = function runTask(task, options) {
const npmPath = options.npmPath || process.env.npm_execpath //eslint-disable-line no-process-env
const npmPathIsJs = typeof npmPath === "string" && /\.m?js/.test(path.extname(npmPath))
const execPath = (npmPathIsJs ? process.execPath : npmPath || "npm")
const isYarn = path.basename(npmPath || "npm").startsWith("yarn")
const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith("yarn") //eslint-disable-line no-process-env
const spawnArgs = ["run"]

if (npmPathIsJs) {
Expand Down

0 comments on commit bb41ef6

Please sign in to comment.