@cannbot-ai/install-helper 0.0.2-beta.73 → 0.0.2-beta.74
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/install.ps1 +1 -51
- package/package.json +6 -6
package/dist/install.ps1
CHANGED
|
@@ -47,57 +47,7 @@ Write-Host ""
|
|
|
47
47
|
Write-Host " CANNBot Install Helper" -ForegroundColor Cyan
|
|
48
48
|
Write-Host ""
|
|
49
49
|
|
|
50
|
-
# 1.
|
|
51
|
-
$hasNode = $false
|
|
52
|
-
try {
|
|
53
|
-
$nodeVersion = & node --version 2>$null
|
|
54
|
-
if ($nodeVersion) {
|
|
55
|
-
$majorVersion = [int]($nodeVersion -replace '^v', '' -replace '\..*', '')
|
|
56
|
-
if ($majorVersion -ge 18) {
|
|
57
|
-
$hasNode = $true
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
} catch {}
|
|
61
|
-
|
|
62
|
-
if ($hasNode) {
|
|
63
|
-
Write-Host " [OK] Node.js $nodeVersion" -ForegroundColor Green
|
|
64
|
-
Write-Host ""
|
|
65
|
-
|
|
66
|
-
# Check if already installed
|
|
67
|
-
try {
|
|
68
|
-
$installedVersion = & install-helper --version 2>$null
|
|
69
|
-
if ($installedVersion) {
|
|
70
|
-
Write-Host " [OK] 检测到已安装 install-helper (版本: $installedVersion)" -ForegroundColor Yellow
|
|
71
|
-
}
|
|
72
|
-
} catch {}
|
|
73
|
-
|
|
74
|
-
Write-Host " Installing @cannbot-ai/install-helper..." -ForegroundColor Cyan
|
|
75
|
-
Write-Host ""
|
|
76
|
-
|
|
77
|
-
$prevEAP = $ErrorActionPreference
|
|
78
|
-
$ErrorActionPreference = "Continue"
|
|
79
|
-
& npm.cmd install -g @cannbot-ai/install-helper
|
|
80
|
-
$npmExit = $LASTEXITCODE
|
|
81
|
-
$ErrorActionPreference = $prevEAP
|
|
82
|
-
if ($npmExit -eq 0) {
|
|
83
|
-
Write-Host ""
|
|
84
|
-
Write-Host " [OK] 安装成功!" -ForegroundColor Green
|
|
85
|
-
Write-Host ""
|
|
86
|
-
Write-Host " 请运行: install-helper" -ForegroundColor Cyan
|
|
87
|
-
return
|
|
88
|
-
} else {
|
|
89
|
-
Write-Host ""
|
|
90
|
-
Write-Host " [ERROR] npm 安装失败" -ForegroundColor Red
|
|
91
|
-
Write-Host ""
|
|
92
|
-
Write-Host " 请尝试以管理员权限运行:"
|
|
93
|
-
Write-Host " npm install -g @cannbot-ai/install-helper"
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# 2. Path B: No Node.js — download prebuilt binary
|
|
99
|
-
|
|
100
|
-
# Detect platform
|
|
50
|
+
# 1. Detect platform
|
|
101
51
|
$Arch = if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "x64" }
|
|
102
52
|
$SubPkgName = "@cannbot-ai/install-helper-windows-$Arch"
|
|
103
53
|
$BinaryName = "install-helper.exe"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cannbot-ai/install-helper",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.74",
|
|
4
4
|
"description": "Install Helper - Interactive installer for CANN operator development skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"yaml": "^2.6.0"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@cannbot-ai/install-helper-linux-x64": "0.0.2-beta.
|
|
46
|
-
"@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.
|
|
47
|
-
"@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.
|
|
48
|
-
"@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.
|
|
49
|
-
"@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.
|
|
45
|
+
"@cannbot-ai/install-helper-linux-x64": "0.0.2-beta.74",
|
|
46
|
+
"@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.74",
|
|
47
|
+
"@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.74",
|
|
48
|
+
"@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.74",
|
|
49
|
+
"@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.74"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^22.0.0",
|