rcwctl 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/README.md +18 -0
- package/bin/rcwctl.js +49 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# rcwctl
|
|
2
|
+
|
|
3
|
+
这是 `rcwctl` 的 npm 元包。安装时会自动拉取当前平台对应的二进制包:
|
|
4
|
+
|
|
5
|
+
- `rcwctl-linux-x64`
|
|
6
|
+
- `rcwctl-linux-arm64`
|
|
7
|
+
- `rcwctl-darwin-x64`
|
|
8
|
+
- `rcwctl-darwin-arm64`
|
|
9
|
+
- `rcwctl-win32-x64`
|
|
10
|
+
- `rcwctl-windows-arm64`
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g rcwctl
|
|
14
|
+
rcwctl --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
这些平台包直接把 `rcwctl` 二进制放进 npm tarball,所以 npm 镜像也能完整分发,不再依赖 GitHub Releases 的安装下载链路。
|
|
18
|
+
平台包本身也暴露 `rcwctl` 命令,但日常安装只需要元包。
|
package/bin/rcwctl.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const { existsSync } = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const packages = {
|
|
8
|
+
"darwin:arm64": "rcwctl-darwin-arm64",
|
|
9
|
+
"darwin:x64": "rcwctl-darwin-x64",
|
|
10
|
+
"linux:arm64": "rcwctl-linux-arm64",
|
|
11
|
+
"linux:x64": "rcwctl-linux-x64",
|
|
12
|
+
"win32:arm64": "rcwctl-windows-arm64",
|
|
13
|
+
"win32:x64": "rcwctl-win32-x64"
|
|
14
|
+
};
|
|
15
|
+
const executable = process.platform === "win32" ? "rcwctl.exe" : "rcwctl";
|
|
16
|
+
const packageName = packages[`${process.platform}:${process.arch}`];
|
|
17
|
+
|
|
18
|
+
if (!packageName) {
|
|
19
|
+
console.error(
|
|
20
|
+
`Unsupported platform: ${process.platform} ${process.arch}. Reinstall rcwctl on a supported platform.`
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let binary;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const packageJson = require.resolve(`${packageName}/package.json`);
|
|
29
|
+
binary = path.join(path.dirname(packageJson), "bin", executable);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error(`rcwctl platform package is missing: ${packageName}. Reinstall rcwctl.`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!existsSync(binary)) {
|
|
36
|
+
console.error(`rcwctl binary is missing from ${packageName}. Reinstall rcwctl.`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const result = spawnSync(binary, process.argv.slice(2), {
|
|
41
|
+
stdio: "inherit"
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (result.error) {
|
|
45
|
+
console.error(result.error.message);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rcwctl",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Meta package for the Remote Control for Windows CLI",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/faithleysath/remote-control-for-windows.git",
|
|
9
|
+
"directory": "npm"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/faithleysath/remote-control-for-windows#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/faithleysath/remote-control-for-windows/issues"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"rcwctl": "bin/rcwctl.js"
|
|
17
|
+
},
|
|
18
|
+
"optionalDependencies": {
|
|
19
|
+
"rcwctl-darwin-arm64": "0.1.1",
|
|
20
|
+
"rcwctl-darwin-x64": "0.1.1",
|
|
21
|
+
"rcwctl-linux-arm64": "0.1.1",
|
|
22
|
+
"rcwctl-linux-x64": "0.1.1",
|
|
23
|
+
"rcwctl-windows-arm64": "0.1.1",
|
|
24
|
+
"rcwctl-win32-x64": "0.1.1"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "node --check bin/rcwctl.js && node scripts/check.js",
|
|
28
|
+
"pack:check": "npm pack --dry-run"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin/",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"keywords": [
|
|
35
|
+
"remote-control",
|
|
36
|
+
"windows",
|
|
37
|
+
"cli",
|
|
38
|
+
"rust"
|
|
39
|
+
],
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
}
|
|
43
|
+
}
|