@tauri-apps/cli 2.0.0-alpha.2 → 2.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/lib.rs CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2019-2022 Tauri Programme within The Commons Conservancy
1
+ // Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // SPDX-License-Identifier: MIT
4
4
 
package/tauri.js CHANGED
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ // Copyright 2019-2023 Tauri Programme within The Commons Conservancy
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ // SPDX-License-Identifier: MIT
6
+
3
7
  const cli = require('./main')
4
8
  const path = require('path')
5
9
 
6
- const [bin, script, ...arguments] = process.argv
10
+ const [bin, script, ...args] = process.argv
7
11
  const binStem = path.parse(bin).name.toLowerCase()
8
12
 
9
13
  // We want to make a helpful binary name for the underlying CLI helper, if we
@@ -16,7 +20,7 @@ if (bin === '@tauri-apps/cli') {
16
20
  }
17
21
  // Even if started by a package manager, the binary will be NodeJS.
18
22
  // Some distribution still use "nodejs" as the binary name.
19
- else if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
23
+ else if (binStem.match(/(nodejs|node|bun)\-?([0-9]*)*$/g)) {
20
24
  const managerStem = process.env.npm_execpath
21
25
  ? path.parse(process.env.npm_execpath).name.toLowerCase()
22
26
  : null
@@ -28,7 +32,7 @@ else if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
28
32
  manager = 'npm'
29
33
  break
30
34
 
31
- // Yarn and pnpm have the same stem name as their bin.
35
+ // Yarn, pnpm, and bun have the same stem name as their bin.
32
36
  // We assume all unknown package managers do as well.
33
37
  default:
34
38
  manager = managerStem
@@ -44,10 +48,10 @@ else if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
44
48
  }
45
49
  } else {
46
50
  // We don't know what started it, assume it's already stripped.
47
- arguments.unshift(bin)
51
+ args.unshift(bin)
48
52
  }
49
53
 
50
- cli.run(arguments, binName).catch((err) => {
54
+ cli.run(args, binName).catch((err) => {
51
55
  cli.logError(err.message)
52
56
  process.exit(1)
53
57
  })