@mo7yw4ng/openape 2.0.3 → 2.0.4
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/openape.js +6 -3
- package/package.json +10 -8
package/bin/openape.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
+
const path_1 = require("path");
|
|
5
6
|
function getExePath() {
|
|
6
7
|
const arch = process.arch;
|
|
7
8
|
let os = process.platform;
|
|
@@ -10,11 +11,13 @@ function getExePath() {
|
|
|
10
11
|
os = "win32";
|
|
11
12
|
ext = ".exe";
|
|
12
13
|
}
|
|
13
|
-
const pkg =
|
|
14
|
+
const pkg = `@mo7yw4ng/openape-${os}-${arch}`;
|
|
14
15
|
try {
|
|
15
|
-
|
|
16
|
+
// Resolve the package directory instead of a specific file
|
|
17
|
+
const pkgJson = require.resolve(`${pkg}/package.json`);
|
|
18
|
+
return (0, path_1.join)(pkgJson, "..", "bin", `openape${ext}`);
|
|
16
19
|
}
|
|
17
|
-
catch {
|
|
20
|
+
catch (e) {
|
|
18
21
|
throw new Error(`Unsupported platform: ${process.platform} ${arch}\n` +
|
|
19
22
|
`Try installing the platform package manually: npm install ${pkg}`);
|
|
20
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mo7yw4ng/openape",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "CLI tool for CYCU i-Learning platform",
|
|
5
5
|
"bin": {
|
|
6
6
|
"openape": "bin/openape.js"
|
|
@@ -9,19 +9,21 @@
|
|
|
9
9
|
"build": "tsc && npx shx mv bin/index.js bin/openape.js"
|
|
10
10
|
},
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"@mo7yw4ng/openape-linux-x64": "2.0.
|
|
13
|
-
"@mo7yw4ng/openape-linux-arm64": "2.0.
|
|
14
|
-
"@mo7yw4ng/openape-darwin-x64": "2.0.
|
|
15
|
-
"@mo7yw4ng/openape-darwin-arm64": "2.0.
|
|
16
|
-
"@mo7yw4ng/openape-win32-x64": "2.0.
|
|
17
|
-
"@mo7yw4ng/openape-win32-arm64": "2.0.
|
|
12
|
+
"@mo7yw4ng/openape-linux-x64": "2.0.4",
|
|
13
|
+
"@mo7yw4ng/openape-linux-arm64": "2.0.4",
|
|
14
|
+
"@mo7yw4ng/openape-darwin-x64": "2.0.4",
|
|
15
|
+
"@mo7yw4ng/openape-darwin-arm64": "2.0.4",
|
|
16
|
+
"@mo7yw4ng/openape-win32-x64": "2.0.4",
|
|
17
|
+
"@mo7yw4ng/openape-win32-arm64": "2.0.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "^5.0.0",
|
|
21
21
|
"@types/node": "^20.0.0"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"bin/"
|
|
24
|
+
"bin/",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
25
27
|
],
|
|
26
28
|
"repository": {
|
|
27
29
|
"type": "git",
|