Explorar o código

fix(cli.js): detect node-20 binary (#6667)

* fix nodejs binary regex

* Update clijs-node-version-20.md
Nathanael Rea %!s(int64=2) %!d(string=hai) anos
pai
achega
fb7ef8dacd
Modificáronse 2 ficheiros con 6 adicións e 1 borrados
  1. 5 0
      .changes/clijs-node-version-20.md
  2. 1 1
      tooling/cli/node/tauri.js

+ 5 - 0
.changes/clijs-node-version-20.md

@@ -0,0 +1,5 @@
+---
+'@tauri-apps/cli': patch
+---
+
+Fix nodejs binary regex when `0` is in the version name, for example `node-20`

+ 1 - 1
tooling/cli/node/tauri.js

@@ -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