Skip to content

Commit

Permalink
fix(cli.js): detect node-20 binary (#6667)
Browse files Browse the repository at this point in the history
* fix nodejs binary regex

* Update clijs-node-version-20.md
  • Loading branch information
NathanaelRea committed May 22, 2023
1 parent 1161b67 commit fb7ef8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/clijs-node-version-20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tauri-apps/cli': patch
---

Fix nodejs binary regex when `0` is in the version name, for example `node-20`
2 changes: 1 addition & 1 deletion tooling/cli/node/tauri.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (bin === '@tauri-apps/cli') {
}
// Even if started by a package manager, the binary will be NodeJS.
// Some distribution still use "nodejs" as the binary name.
else if (binStem.match(/(nodejs|node)\-?([1-9]*)*$/g)) {
else if (binStem.match(/(nodejs|node)\-?([0-9]*)*$/g)) {
const managerStem = process.env.npm_execpath
? path.parse(process.env.npm_execpath).name.toLowerCase()
: null
Expand Down

0 comments on commit fb7ef8d

Please sign in to comment.