Skip to content

Commit

Permalink
When running through npx, use the npm that should be next to it.
Browse files Browse the repository at this point in the history
This should improve things hopefully.
  • Loading branch information
bcomnes committed Nov 9, 2022
1 parent 3830e4b commit 61e84ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ env:
NODE_VERSION: 'lts/*'
FORCE_COLOR: 2

concurrency: # prevent concurrent releases
group: npm-bump
cancel-in-progress: true

jobs:
version_and_release:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion lib/run-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ module.exports = function runTask(task, options) {
}

// Execute.
const npmPath = options.npmPath || process.env.NPM_CLI_JS || process.env.npm_execpath //eslint-disable-line no-process-env
const npmPath = options.npmPath || path.basename(process.env.npm_execpath).startsWith("npx") //eslint-disable-line no-process-env
? path.join(path.dirname(process.env.npm_execpath), path.basename(process.env.npm_execpath).replace("npx", "npm")) //eslint-disable-line no-process-env
: 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 = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith("yarn") //eslint-disable-line no-process-env
Expand Down

0 comments on commit 61e84ea

Please sign in to comment.