mobilecli 1.0.6 → 1.0.7

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/index.js CHANGED
@@ -3,16 +3,19 @@
3
3
  const { join } = require("node:path");
4
4
  const { spawn } = require("node:child_process");
5
5
 
6
- let binary;
6
+ let packageName;
7
+ let binaryName;
7
8
 
8
9
  switch (process.platform) {
9
10
  case "darwin":
10
11
  switch (process.arch) {
11
12
  case "arm64":
12
- binary = "mobilecli-darwin-arm64";
13
+ packageName = "@mobilenext/mobilecli-darwin-arm64";
14
+ binaryName = "mobilecli-darwin-arm64";
13
15
  break;
14
16
  case "x64":
15
- binary = "mobilecli-darwin-amd64";
17
+ packageName = "@mobilenext/mobilecli-darwin-amd64";
18
+ binaryName = "mobilecli-darwin-amd64";
16
19
  break;
17
20
  }
18
21
  break;
@@ -20,10 +23,12 @@ switch (process.platform) {
20
23
  case "linux":
21
24
  switch (process.arch) {
22
25
  case "arm64":
23
- binary = "mobilecli-linux-arm64";
26
+ packageName = "@mobilenext/mobilecli-linux-arm64";
27
+ binaryName = "mobilecli-linux-arm64";
24
28
  break;
25
29
  case "x64":
26
- binary = "mobilecli-linux-amd64";
30
+ packageName = "@mobilenext/mobilecli-linux-amd64";
31
+ binaryName = "mobilecli-linux-amd64";
27
32
  break;
28
33
  }
29
34
  break;
@@ -31,21 +36,30 @@ switch (process.platform) {
31
36
  case "win32":
32
37
  switch (process.arch) {
33
38
  case "arm64":
34
- binary = "mobilecli-windows-arm64.exe";
39
+ packageName = "@mobilenext/mobilecli-windows-arm64";
40
+ binaryName = "mobilecli-windows-arm64.exe";
35
41
  break;
36
42
  case "x64":
37
- binary = "mobilecli-windows-amd64.exe";
43
+ packageName = "@mobilenext/mobilecli-windows-amd64";
44
+ binaryName = "mobilecli-windows-amd64.exe";
38
45
  break;
39
46
  }
40
47
  break;
41
48
  }
42
49
 
43
- if (!binary) {
50
+ if (!packageName) {
44
51
  console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
45
52
  process.exit(1);
46
53
  }
47
54
 
48
- const binaryPath = join(__dirname, "bin", binary);
55
+ let binaryPath;
56
+ try {
57
+ const packagePath = require.resolve(`${packageName}/package.json`);
58
+ binaryPath = join(packagePath, "..", binaryName);
59
+ } catch (error) {
60
+ console.error(`Failed to find ${packageName}. Please reinstall @mobilenext/mobilecli.`);
61
+ process.exit(1);
62
+ }
49
63
 
50
64
  const args = process.argv.slice(2);
51
65
  const child = spawn(binaryPath, args, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobilecli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "author": "Mobile Next",
5
5
  "description": "A universal command-line tool for managing iOS and Android devices, simulators, emulators and apps",
6
6
  "repository": {
@@ -10,5 +10,13 @@
10
10
  "license": "MIT",
11
11
  "bin": {
12
12
  "mobilecli": "index.js"
13
+ },
14
+ "optionalDependencies": {
15
+ "@mobilenext/mobilecli-darwin-amd64": "1.0.7",
16
+ "@mobilenext/mobilecli-darwin-arm64": "1.0.7",
17
+ "@mobilenext/mobilecli-linux-amd64": "1.0.7",
18
+ "@mobilenext/mobilecli-linux-arm64": "1.0.7",
19
+ "@mobilenext/mobilecli-windows-amd64": "1.0.7",
20
+ "@mobilenext/mobilecli-windows-arm64": "1.0.7"
13
21
  }
14
22
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file