@cannbot-ai/install-helper 0.0.2-beta.71 → 0.0.2-beta.73

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.
Files changed (2) hide show
  1. package/dist/install.ps1 +16 -12
  2. package/package.json +6 -6
package/dist/install.ps1 CHANGED
@@ -22,7 +22,7 @@ trap {
22
22
  Write-Host ""
23
23
  Write-Host " Press Enter to exit..."
24
24
  Read-Host
25
- exit 1
25
+ return
26
26
  }
27
27
 
28
28
  function Compare-SemVer($a, $b) {
@@ -71,23 +71,27 @@ if ($hasNode) {
71
71
  }
72
72
  } catch {}
73
73
 
74
- Write-Host " 正在安装 @cannbot-ai/install-helper..." -ForegroundColor Cyan
74
+ Write-Host " Installing @cannbot-ai/install-helper..." -ForegroundColor Cyan
75
75
  Write-Host ""
76
76
 
77
- & npm.cmd install -g @cannbot-ai/install-helper 2>&1
78
- if ($LASTEXITCODE -eq 0) {
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) {
79
83
  Write-Host ""
80
84
  Write-Host " [OK] 安装成功!" -ForegroundColor Green
81
85
  Write-Host ""
82
86
  Write-Host " 请运行: install-helper" -ForegroundColor Cyan
83
- exit 0
87
+ return
84
88
  } else {
85
89
  Write-Host ""
86
90
  Write-Host " [ERROR] npm 安装失败" -ForegroundColor Red
87
91
  Write-Host ""
88
92
  Write-Host " 请尝试以管理员权限运行:"
89
93
  Write-Host " npm install -g @cannbot-ai/install-helper"
90
- exit 1
94
+ return
91
95
  }
92
96
  }
93
97
 
@@ -144,7 +148,7 @@ if (-not $Version) {
144
148
  Write-Host ""
145
149
  Write-Host " Alternative (requires Node.js 18+):"
146
150
  Write-Host " npm install -g @cannbot-ai/install-helper"
147
- exit 1
151
+ return
148
152
  }
149
153
 
150
154
  # 3. Download tarball (with mirror fallback)
@@ -176,7 +180,7 @@ if (-not $Downloaded) {
176
180
  Write-Host ""
177
181
  Write-Host " Alternative (requires Node.js 18+):"
178
182
  Write-Host " npm install -g @cannbot-ai/install-helper"
179
- exit 1
183
+ return
180
184
  }
181
185
 
182
186
  # 4. Extract
@@ -186,7 +190,7 @@ $TempExtract = Join-Path $env:TEMP "ih-extract-$(Get-Random)"
186
190
  New-Item -ItemType Directory -Force -Path $TempExtract | Out-Null
187
191
 
188
192
  try {
189
- & tar xzf $TempFile -C $TempExtract 2>&1 | Out-Null
193
+ & tar xzf $TempFile -C $TempExtract 2>$null
190
194
  if ($LASTEXITCODE -ne 0) {
191
195
  throw "tar exit code $LASTEXITCODE"
192
196
  }
@@ -195,7 +199,7 @@ try {
195
199
  Write-Host " Windows 10 1803+ includes tar. For older Windows, use npm install."
196
200
  Remove-Item $TempExtract -Recurse -Force -ErrorAction SilentlyContinue
197
201
  Remove-Item $TempFile -Force -ErrorAction SilentlyContinue
198
- exit 1
202
+ return
199
203
  }
200
204
 
201
205
  $BinarySrc = Join-Path $TempExtract "package\$BinaryName"
@@ -205,7 +209,7 @@ if (-not (Test-Path $BinarySrc)) {
205
209
  Write-Host " [ERROR] Binary not found in tarball: $BinarySrc" -ForegroundColor Red
206
210
  Remove-Item $TempExtract -Recurse -Force -ErrorAction SilentlyContinue
207
211
  Remove-Item $TempFile -Force -ErrorAction SilentlyContinue
208
- exit 1
212
+ return
209
213
  }
210
214
 
211
215
  Copy-Item $BinarySrc $BinaryDest -Force
@@ -229,7 +233,7 @@ if (-not $UserPath) {
229
233
 
230
234
  # 6. Verify binary and launch
231
235
  try {
232
- $null = & $BinaryDest --version 2>&1
236
+ $null = & $BinaryDest --version 2>$null
233
237
  Write-Host " Launching install-helper..." -ForegroundColor Cyan
234
238
  Write-Host ""
235
239
  & $BinaryDest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cannbot-ai/install-helper",
3
- "version": "0.0.2-beta.71",
3
+ "version": "0.0.2-beta.73",
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.71",
46
- "@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.71",
47
- "@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.71",
48
- "@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.71",
49
- "@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.71"
45
+ "@cannbot-ai/install-helper-linux-x64": "0.0.2-beta.73",
46
+ "@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.73",
47
+ "@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.73",
48
+ "@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.73",
49
+ "@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.73"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.0.0",