@steambrew/plgpack 1.0.0
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/bin/plgpack.js +32 -0
- package/package.json +16 -0
package/bin/plgpack.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
|
|
9
|
+
const platform = os.platform(); // 'win32', 'linux', 'darwin'
|
|
10
|
+
const arch = os.arch(); // 'x64', 'arm64'
|
|
11
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
12
|
+
|
|
13
|
+
const bin = path.join(
|
|
14
|
+
__dirname,
|
|
15
|
+
"..",
|
|
16
|
+
"binaries",
|
|
17
|
+
`plgpack-${platform}-${arch}${ext}`,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
if (!fs.existsSync(bin)) {
|
|
21
|
+
console.error(`plgpack: no binary for ${platform}/${arch} at ${bin}`);
|
|
22
|
+
console.error(
|
|
23
|
+
"Pre-built binaries are distributed via CI. To build from source: cargo build --release",
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
30
|
+
} catch (e) {
|
|
31
|
+
process.exit(e.status ?? 1);
|
|
32
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@steambrew/plgpack",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Pack Millennium plugins into .plg format",
|
|
5
|
+
"bin": {
|
|
6
|
+
"plgpack": "bin/plgpack.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/",
|
|
10
|
+
"binaries/"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=16"
|
|
14
|
+
},
|
|
15
|
+
"private": false
|
|
16
|
+
}
|