@dptech-corp/bohr-cli 2.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.
Binary file
Binary file
Binary file
Binary file
package/install.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const os = require("os");
5
+
6
+ const platform = os.platform();
7
+ const arch = os.arch();
8
+
9
+ const archMap = { x64: "amd64", arm64: "arm64" };
10
+ const mappedArch = archMap[arch];
11
+
12
+ if (!mappedArch || !["darwin", "linux"].includes(platform)) {
13
+ console.error(`Unsupported platform: ${platform}-${arch}`);
14
+ process.exit(1);
15
+ }
16
+
17
+ const binaryName = `bohr-${platform}-${mappedArch}`;
18
+ const binaryPath = path.join(__dirname, "bin", binaryName);
19
+
20
+ if (!fs.existsSync(binaryPath)) {
21
+ console.error(`Binary not found: ${binaryPath}`);
22
+ process.exit(1);
23
+ }
24
+
25
+ fs.chmodSync(binaryPath, 0o755);
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@dptech-corp/bohr-cli",
3
+ "version": "2.0.0",
4
+ "description": "CLI tool for Bohrium scientific computing platform",
5
+ "bin": {
6
+ "bohr": "run.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node install.js"
10
+ },
11
+ "keywords": [
12
+ "bohrium",
13
+ "scientific-computing",
14
+ "cli",
15
+ "paper-search",
16
+ "molecular-dynamics"
17
+ ],
18
+ "author": "DP Technology",
19
+ "license": "MIT",
20
+ "os": [
21
+ "darwin",
22
+ "linux"
23
+ ],
24
+ "cpu": [
25
+ "x64",
26
+ "arm64"
27
+ ],
28
+ "files": [
29
+ "bin/",
30
+ "run.js",
31
+ "install.js"
32
+ ]
33
+ }
package/run.js ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ const { execFileSync } = require("child_process");
3
+ const path = require("path");
4
+ const os = require("os");
5
+
6
+ const platform = os.platform();
7
+ const arch = os.arch();
8
+ const archMap = { x64: "amd64", arm64: "arm64" };
9
+ const mappedArch = archMap[arch];
10
+
11
+ const binaryName = `bohr-${platform}-${mappedArch}`;
12
+ const binaryPath = path.join(__dirname, "bin", binaryName);
13
+
14
+ try {
15
+ execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
16
+ } catch (e) {
17
+ process.exit(e.status || 1);
18
+ }