@domsync/cli 0.0.0-stage → 1.0.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/domsync.js +31 -0
- package/package.json +26 -4
- package/README.md +0 -3
package/bin/domsync.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawnSync } = require("node:child_process");
|
|
3
|
+
const path = require("node:path");
|
|
4
|
+
|
|
5
|
+
const map = {
|
|
6
|
+
"darwin-arm64": "@domsync/darwin-arm64",
|
|
7
|
+
"darwin-x64": "@domsync/darwin-x64",
|
|
8
|
+
"linux-arm64": "@domsync/linux-arm64",
|
|
9
|
+
"linux-x64": "@domsync/linux-x64",
|
|
10
|
+
"win32-arm64": "@domsync/win32-arm64",
|
|
11
|
+
"win32-x64": "@domsync/win32-x64",
|
|
12
|
+
};
|
|
13
|
+
const pkg = map[`${process.platform}-${process.arch}`];
|
|
14
|
+
if (!pkg) {
|
|
15
|
+
console.error(`domsync: unsupported platform ${process.platform}-${process.arch}`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
let bin;
|
|
19
|
+
try {
|
|
20
|
+
const dir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
21
|
+
bin = path.join(dir, process.platform === "win32" ? "domsync.exe" : "domsync");
|
|
22
|
+
} catch {
|
|
23
|
+
console.error(`domsync: missing optional dependency ${pkg}; reinstall without --omit=optional`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
27
|
+
if (result.error) {
|
|
28
|
+
console.error(`domsync: ${result.error.message}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domsync/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Sync a local domain list to an OpenClash rule-provider file",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"domsync": "bin/domsync.js"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/neiromaster/domsync.git"
|
|
12
|
+
},
|
|
13
|
+
"optionalDependencies": {
|
|
14
|
+
"@domsync/darwin-arm64": "1.0.1",
|
|
15
|
+
"@domsync/darwin-x64": "1.0.1",
|
|
16
|
+
"@domsync/linux-arm64": "1.0.1",
|
|
17
|
+
"@domsync/linux-x64": "1.0.1",
|
|
18
|
+
"@domsync/win32-arm64": "1.0.1",
|
|
19
|
+
"@domsync/win32-x64": "1.0.1"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"provenance": true,
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/README.md
DELETED