@paimaexample/npm-midnight-node 0.3.21 → 0.3.26
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 +4 -1
- package/index.js +7 -1
- package/package.json +1 -1
- package/run_midnight_node.js +1 -1
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",
|
|
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
|
-
|
|
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
package/run_midnight_node.js
CHANGED
|
@@ -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);
|