Skip to content

Commit 7a231cd

Browse files
fix(cli): detect deno (#5475)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
1 parent 6ca8a05 commit 7a231cd

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
---
2-
"cli.js": patch
3-
---
4-
5-
Fix crash when nodejs binary has the version in its name, for example `node18`
1+
---
2+
"cli.js": patch
3+
---
4+
5+
Fix crash when nodejs binary has the version in its name, for example `node18` or when running through deno.

tooling/cli/node/tauri.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ const binStem = path.parse(bin).name.toLowerCase()
1010
// can successfully detect what command likely started the execution.
1111
let binName
1212

13+
// deno run -A --unstable --node-modules-dir npm:@tauri-apps/cli
14+
if (bin === '@tauri-apps/cli') {
15+
binName = '@tauri-apps/cli'
16+
}
1317
// Even if started by a package manager, the binary will be NodeJS.
1418
// Some distribution still use "nodejs" as the binary name.
15-
if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
19+
else if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
1620
const managerStem = process.env.npm_execpath
1721
? path.parse(process.env.npm_execpath).name.toLowerCase()
1822
: null

0 commit comments

Comments
 (0)