Skip to content

Commit

Permalink
fix(cli.js): fix invoking cli from a node shim, closes #5343 (#5345)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 4, 2022
1 parent a4aec9f commit 095b186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/cli.js-node-shim.md
@@ -0,0 +1,5 @@
---
"cli.js": patch
---

Fix crash when nodejs binary has the version in its name, for example `node18`
2 changes: 1 addition & 1 deletion tooling/cli/node/tauri.js
Expand Up @@ -12,7 +12,7 @@ let binName

// Even if started by a package manager, the binary will be NodeJS.
// Some distribution still use "nodejs" as the binary name.
if (binStem === 'node' || binStem === 'nodejs') {
if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
const managerStem = process.env.npm_execpath
? path.parse(process.env.npm_execpath).name.toLowerCase()
: null
Expand Down

0 comments on commit 095b186

Please sign in to comment.