@lynshen/cli 0.0.0-stage → 0.8.7
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/LICENSE +201 -0
- package/NOTICE +46 -0
- package/THIRD-PARTY-NOTICES.txt +24620 -0
- package/bin/lynshen.cjs +45 -0
- package/package.json +24 -4
- package/README.md +0 -3
package/bin/lynshen.cjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
|
|
5
|
+
const packageByPlatform = {
|
|
6
|
+
"linux:x64": "@lynshen/cli-linux-x64",
|
|
7
|
+
"win32:x64": "@lynshen/cli-win32-x64",
|
|
8
|
+
"darwin:arm64": "@lynshen/cli-darwin-arm64",
|
|
9
|
+
"darwin:x64": "@lynshen/cli-darwin-x64"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const selector = `${process.platform}:${process.arch}`;
|
|
13
|
+
const packageName = packageByPlatform[selector];
|
|
14
|
+
|
|
15
|
+
if (!packageName) {
|
|
16
|
+
console.error(`Unsupported platform: ${selector}`);
|
|
17
|
+
console.error("Install a release from GitHub Releases for this platform.");
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const executableName = process.platform === "win32" ? "lynshen.exe" : "lynshen";
|
|
22
|
+
|
|
23
|
+
let executablePath;
|
|
24
|
+
try {
|
|
25
|
+
executablePath = require.resolve(`${packageName}/bin/${executableName}`);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error(`Missing native package ${packageName}.`);
|
|
28
|
+
console.error("Reinstall the package or use a GitHub Release artifact directly.");
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const result = spawnSync(executablePath, process.argv.slice(2), {
|
|
33
|
+
stdio: "inherit"
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (result.error) {
|
|
37
|
+
console.error(result.error.message);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (typeof result.status === "number") {
|
|
42
|
+
process.exit(result.status);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynshen/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.8.7",
|
|
4
|
+
"description": "LynShen native CLI",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"lynshen": "bin/lynshen.cjs"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin/lynshen.cjs",
|
|
14
|
+
"NOTICE",
|
|
15
|
+
"THIRD-PARTY-NOTICES.txt"
|
|
16
|
+
],
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@lynshen/cli-linux-x64": "0.8.7",
|
|
19
|
+
"@lynshen/cli-win32-x64": "0.8.7",
|
|
20
|
+
"@lynshen/cli-darwin-arm64": "0.8.7",
|
|
21
|
+
"@lynshen/cli-darwin-x64": "0.8.7"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/README.md
DELETED