@paimaexample/npm-midnight-node 0.3.21 → 0.3.22

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/binary.js CHANGED
@@ -49,9 +49,12 @@ async function unzipBinary() {
49
49
  });
50
50
  const platform = getPlatform();
51
51
  const parts = platform.split("-");
52
+ const binaryName = (parts[0] === "linux" && parts[1] === "amd64")
53
+ ? `midnight-node-${platform}`
54
+ : "midnight-node";
52
55
  if (parts[0] === "linux") {
53
56
  fs.chmodSync(
54
- path.join(__dirname, "midnight-node", `midnight-node-${platform}`),
57
+ path.join(__dirname, "midnight-node", binaryName),
55
58
  0o755,
56
59
  );
57
60
  }
package/index.js CHANGED
@@ -1,10 +1,16 @@
1
1
  const { binary } = require("./binary");
2
2
  const { runMidnightNode } = require("./run_midnight_node");
3
+ const { getPlatform } = require("./binary");
3
4
  const fs = require("fs");
4
5
  const path = require("path");
5
6
 
6
7
  function checkIfBinaryExists() {
7
- return fs.existsSync(path.join(__dirname, "midnight-node", "midnight-node"));
8
+ const platform = getPlatform();
9
+ const parts = platform.split("-");
10
+ const binaryName = (parts[0] === "linux" && parts[1] === "amd64")
11
+ ? `midnight-node-${platform}`
12
+ : "midnight-node";
13
+ return fs.existsSync(path.join(__dirname, "midnight-node", binaryName));
8
14
  }
9
15
 
10
16
  async function main(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paimaexample/npm-midnight-node",
3
- "version": "0.3.21",
3
+ "version": "0.3.22",
4
4
  "description": "Downloads and starts the binary for Midnight Node",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@ const { getPlatform } = require("./binary");
10
10
  function runMidnightNode(env = process.env, args = []) {
11
11
  const platform = getPlatform();
12
12
  const parts = platform.split("-");
13
- const binaryName = (parts[0] === "linux")
13
+ const binaryName = (parts[0] === "linux" && parts[1] === "amd64")
14
14
  ? `midnight-node-${platform}`
15
15
  : "midnight-node";
16
16
  const binaryPath = path.join(__dirname, "midnight-node", binaryName);