@superblog/cli 0.1.1
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.js +36 -0
- package/package.json +16 -0
package/bin.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the superblog CLI. The real program is a native binary shipped
|
|
3
|
+
// in a per-platform package; this resolves the right one and hands over.
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
|
|
6
|
+
const packages = {
|
|
7
|
+
"darwin arm64": "@superblog/darwin-arm64",
|
|
8
|
+
"darwin x64": "@superblog/darwin-x64",
|
|
9
|
+
"linux x64": "@superblog/linux-x64",
|
|
10
|
+
"linux arm64": "@superblog/linux-arm64",
|
|
11
|
+
"win32 x64": "@superblog/windows-x64",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const key = process.platform + " " + process.arch;
|
|
15
|
+
const pkg = packages[key];
|
|
16
|
+
if (!pkg) {
|
|
17
|
+
console.error("superblog: no prebuilt binary for " + key);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const fs = require("fs");
|
|
23
|
+
const binName = process.platform === "win32" ? "superblog.exe" : "superblog";
|
|
24
|
+
let bin;
|
|
25
|
+
try {
|
|
26
|
+
const pkgDir = path.dirname(require.resolve(pkg + "/package.json"));
|
|
27
|
+
bin = path.join(pkgDir, "bin", binName);
|
|
28
|
+
if (!fs.existsSync(bin)) throw new Error("binary missing");
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error("superblog: the platform package " + pkg + " is missing.");
|
|
31
|
+
console.error("Reinstall with: npm i -g superblog");
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
36
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@superblog/cli",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Build custom templates for your Superblog: develop with live reload, preview, and deploy.",
|
|
5
|
+
"homepage": "https://superblog.ai",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"bin": { "superblog": "bin.js" },
|
|
8
|
+
"engines": { "node": ">=18" },
|
|
9
|
+
"optionalDependencies": {
|
|
10
|
+
"@superblog/darwin-arm64": "0.1.1",
|
|
11
|
+
"@superblog/darwin-x64": "0.1.1",
|
|
12
|
+
"@superblog/linux-x64": "0.1.1",
|
|
13
|
+
"@superblog/linux-arm64": "0.1.1",
|
|
14
|
+
"@superblog/windows-x64": "0.1.1"
|
|
15
|
+
}
|
|
16
|
+
}
|