@yaakapp/cli 0.0.39 → 0.0.41

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.
Files changed (2) hide show
  1. package/bin/cli.js +3 -17
  2. package/package.json +5 -5
package/bin/cli.js CHANGED
@@ -2,28 +2,14 @@
2
2
 
3
3
  const path = require("path");
4
4
  const childProcess = require("child_process");
5
-
6
- // Lookup table for all platforms and binary distribution packages
7
- const BINARY_DISTRIBUTION_PACKAGES = {
8
- darwin: "npm-binary-example-darwin",
9
- linux: "npm-binary-example-linux",
10
- freebsd: "npm-binary-example-linux",
11
- win32: "npm-binary-example-win32",
12
- };
13
-
14
- // Windows binaries end with .exe so we need to special case them.
15
- const binaryName = process.platform === "win32" ? "my-binary.exe" : "my-binary";
16
-
17
- // Determine package name for this platform
18
- const platformSpecificPackageName =
19
- BINARY_DISTRIBUTION_PACKAGES[process.platform];
5
+ const {BINARY_NAME, PLATFORM_SPECIFIC_PACKAGE_NAME} = require("../common");
20
6
 
21
7
  function getBinaryPath() {
22
8
  try {
23
9
  // Resolving will fail if the optionalDependency was not installed
24
- return require.resolve(`${platformSpecificPackageName}/bin/${binaryName}`);
10
+ return require.resolve(`${PLATFORM_SPECIFIC_PACKAGE_NAME}/bin/${BINARY_NAME}`);
25
11
  } catch (e) {
26
- return path.join(__dirname, "..", binaryName);
12
+ return path.join(__dirname, "..", BINARY_NAME);
27
13
  }
28
14
  }
29
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaakapp/cli",
3
- "version": "v0.0.39",
3
+ "version": "v0.0.41",
4
4
  "main": "./index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,9 +13,9 @@
13
13
  "yaakcli": "bin/cli.js"
14
14
  },
15
15
  "optionalDependencies": {
16
- "@yaakapp/cli-darwin-x64": "v0.0.39",
17
- "@yaakapp/cli-darwin-arm64": "v0.0.39",
18
- "@yaakapp/cli-linux-x64": "v0.0.39",
19
- "@yaakapp/cli-win32-x64": "v0.0.39"
16
+ "@yaakapp/cli-darwin-x64": "v0.0.41",
17
+ "@yaakapp/cli-darwin-arm64": "v0.0.41",
18
+ "@yaakapp/cli-linux-x64": "v0.0.41",
19
+ "@yaakapp/cli-win32-x64": "v0.0.41"
20
20
  }
21
21
  }