@tauri-apps/cli 2.0.0-alpha.9 → 2.0.0-beta.1

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
@@ -12,7 +12,7 @@ pub fn run(args: Vec<String>, bin_name: Option<String>, callback: JsFunction) ->
12
12
  let function: ThreadsafeFunction<bool, ErrorStrategy::CalleeHandled> = callback
13
13
  .create_threadsafe_function(0, |ctx| ctx.env.get_boolean(ctx.value).map(|v| vec![v]))?;
14
14
 
15
- // we need to run in a separate thread so Node.js (e.g. vue-cli-plugin-tauri) consumers
15
+ // we need to run in a separate thread so Node.js consumers
16
16
  // can do work while `tauri dev` is running.
17
17
  std::thread::spawn(move || match tauri_cli::try_run(args, bin_name) {
18
18
  Ok(_) => function.call(Ok(true), ThreadsafeFunctionCallMode::Blocking),
package/tauri.js CHANGED
@@ -7,7 +7,7 @@
7
7
  const cli = require('./main')
8
8
  const path = require('path')
9
9
 
10
- const [bin, script, ...arguments] = process.argv
10
+ const [bin, script, ...args] = process.argv
11
11
  const binStem = path.parse(bin).name.toLowerCase()
12
12
 
13
13
  // We want to make a helpful binary name for the underlying CLI helper, if we
@@ -20,7 +20,7 @@ if (bin === '@tauri-apps/cli') {
20
20
  }
21
21
  // Even if started by a package manager, the binary will be NodeJS.
22
22
  // 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|bun)\-?([0-9]*)*$/g)) {
24
24
  const managerStem = process.env.npm_execpath
25
25
  ? path.parse(process.env.npm_execpath).name.toLowerCase()
26
26
  : null
@@ -32,7 +32,7 @@ else if (binStem.match(/(nodejs|node)\-?([1-9]*)*$/g)) {
32
32
  manager = 'npm'
33
33
  break
34
34
 
35
- // Yarn and pnpm have the same stem name as their bin.
35
+ // Yarn, pnpm, and bun have the same stem name as their bin.
36
36
  // We assume all unknown package managers do as well.
37
37
  default:
38
38
  manager = managerStem
@@ -48,10 +48,10 @@ else if (binStem.match(/(nodejs|node)\-?([1-9]*)*$/g)) {
48
48
  }
49
49
  } else {
50
50
  // We don't know what started it, assume it's already stripped.
51
- arguments.unshift(bin)
51
+ args.unshift(bin)
52
52
  }
53
53
 
54
- cli.run(arguments, binName).catch((err) => {
54
+ cli.run(args, binName).catch((err) => {
55
55
  cli.logError(err.message)
56
56
  process.exit(1)
57
57
  })