@cannbot-ai/install-helper 1.1.10 → 1.1.11-beta.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.
- package/dist/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/bin/install-helper.js +0 -59
- package/bin/package.json +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cannbot-ai/install-helper",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11-beta.0",
|
|
4
4
|
"description": "Install Helper - Interactive installer for CANN operator development skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"yaml": "^2.6.0"
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
|
-
"@cannbot-ai/install-helper-linux-x64": "1.1.
|
|
47
|
-
"@cannbot-ai/install-helper-linux-arm64": "1.1.
|
|
48
|
-
"@cannbot-ai/install-helper-darwin-x64": "1.1.
|
|
49
|
-
"@cannbot-ai/install-helper-darwin-arm64": "1.1.
|
|
50
|
-
"@cannbot-ai/install-helper-windows-x64": "1.1.
|
|
46
|
+
"@cannbot-ai/install-helper-linux-x64": "1.1.11-beta.0",
|
|
47
|
+
"@cannbot-ai/install-helper-linux-arm64": "1.1.11-beta.0",
|
|
48
|
+
"@cannbot-ai/install-helper-darwin-x64": "1.1.11-beta.0",
|
|
49
|
+
"@cannbot-ai/install-helper-darwin-arm64": "1.1.11-beta.0",
|
|
50
|
+
"@cannbot-ai/install-helper-windows-x64": "1.1.11-beta.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.0.0",
|
package/bin/install-helper.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// ----------------------------------------------------------------------------------------------------------
|
|
3
|
-
// Copyright (c) 2026 Huawei Technologies Co., Ltd.
|
|
4
|
-
// This program is free software, you can redistribute it and/or modify it under the terms and conditions of
|
|
5
|
-
// CANN Open Software License Agreement Version 2.0 (the "License").
|
|
6
|
-
// Please refer to the License for details. You may not use this file except in compliance with the License.
|
|
7
|
-
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
|
8
|
-
// INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
-
// See LICENSE in the root of the software repository for the full text of the License.
|
|
10
|
-
// ----------------------------------------------------------------------------------------------------------
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { spawn } = require("child_process");
|
|
14
|
-
const { existsSync } = require("fs");
|
|
15
|
-
const { join, dirname } = require("path");
|
|
16
|
-
|
|
17
|
-
const PLATFORM_MAP = {
|
|
18
|
-
"linux-x64": "@cannbot-ai/install-helper-linux-x64",
|
|
19
|
-
"linux-arm64": "@cannbot-ai/install-helper-linux-arm64",
|
|
20
|
-
"darwin-x64": "@cannbot-ai/install-helper-darwin-x64",
|
|
21
|
-
"darwin-arm64": "@cannbot-ai/install-helper-darwin-arm64",
|
|
22
|
-
"win32-x64": "@cannbot-ai/install-helper-windows-x64",
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const key = `${process.platform}-${process.arch}`;
|
|
26
|
-
const pkgName = PLATFORM_MAP[key];
|
|
27
|
-
const binaryName = process.platform === "win32" ? "install-helper.exe" : "install-helper";
|
|
28
|
-
const args = process.argv.slice(2);
|
|
29
|
-
|
|
30
|
-
if (pkgName) {
|
|
31
|
-
try {
|
|
32
|
-
const pkgPath = require.resolve(`${pkgName}/package.json`);
|
|
33
|
-
const binaryPath = join(dirname(pkgPath), binaryName);
|
|
34
|
-
if (existsSync(binaryPath)) {
|
|
35
|
-
const child = spawn(binaryPath, args, { stdio: "inherit" });
|
|
36
|
-
child.on("exit", (code, signal) => { process.exit(code ?? (signal ? 1 : 0)); });
|
|
37
|
-
child.on("error", () => runJSFallback());
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
} catch {}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
runJSFallback();
|
|
44
|
-
|
|
45
|
-
function runJSFallback() {
|
|
46
|
-
const jsPath = join(__dirname, "..", "dist", "index.js");
|
|
47
|
-
if (existsSync(jsPath)) {
|
|
48
|
-
const child = spawn(process.execPath, [jsPath, ...args], { stdio: "inherit" });
|
|
49
|
-
child.on("exit", (code, signal) => { process.exit(code ?? (signal ? 1 : 0)); });
|
|
50
|
-
child.on("error", () => {
|
|
51
|
-
console.error("install-helper: failed to run");
|
|
52
|
-
process.exit(1);
|
|
53
|
-
});
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
console.error(`install-helper binary not found for ${key}`);
|
|
57
|
-
console.error("Try: npm install -g @cannbot-ai/install-helper");
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
package/bin/package.json
DELETED