Skip to content

Commit fb7ef8d

Browse files
authored
fix(cli.js): detect node-20 binary (#6667)
* fix nodejs binary regex * Update clijs-node-version-20.md
1 parent 1161b67 commit fb7ef8d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changes/clijs-node-version-20.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tauri-apps/cli': patch
3+
---
4+
5+
Fix nodejs binary regex when `0` is in the version name, for example `node-20`

tooling/cli/node/tauri.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if (bin === '@tauri-apps/cli') {
2020
}
2121
// Even if started by a package manager, the binary will be NodeJS.
2222
// Some distribution still use "nodejs" as the binary name.
23-
else if (binStem.match(/(nodejs|node)\-?([1-9]*)*$/g)) {
23+
else if (binStem.match(/(nodejs|node)\-?([0-9]*)*$/g)) {
2424
const managerStem = process.env.npm_execpath
2525
? path.parse(process.env.npm_execpath).name.toLowerCase()
2626
: null

0 commit comments

Comments
 (0)