@cannbot-ai/install-helper 0.0.2-beta.45 → 0.0.2-beta.47
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 +26 -22
- package/package.json +6 -6
package/dist/install.ps1
CHANGED
|
@@ -37,25 +37,31 @@ Write-Host ""
|
|
|
37
37
|
Write-Host " Querying latest version..." -ForegroundColor Cyan
|
|
38
38
|
|
|
39
39
|
$Mirrors = @(
|
|
40
|
-
"https://registry.
|
|
41
|
-
"https://registry.
|
|
40
|
+
"https://registry.npmjs.org",
|
|
41
|
+
"https://registry.npmmirror.com"
|
|
42
42
|
)
|
|
43
43
|
|
|
44
44
|
$Version = $null
|
|
45
45
|
$Registry = $null
|
|
46
46
|
foreach ($url in $Mirrors) {
|
|
47
|
-
foreach ($tag in @("
|
|
47
|
+
foreach ($tag in @("beta", "latest")) {
|
|
48
48
|
try {
|
|
49
49
|
$resp = Invoke-RestMethod "$url/$SubPkgName/$tag" -TimeoutSec 15
|
|
50
|
-
if ($resp.version
|
|
51
|
-
$Version
|
|
52
|
-
|
|
50
|
+
if ($resp.version) {
|
|
51
|
+
if (-not $Version) {
|
|
52
|
+
$Version = $resp.version
|
|
53
|
+
$Registry = $url
|
|
54
|
+
} elseif ($resp.version -gt $Version) {
|
|
55
|
+
$Version = $resp.version
|
|
56
|
+
$Registry = $url
|
|
57
|
+
}
|
|
53
58
|
}
|
|
54
59
|
} catch {}
|
|
55
60
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
if ($Version) {
|
|
62
|
+
Write-Host " [OK] Version: $Version (from $Registry)" -ForegroundColor Green
|
|
63
|
+
break
|
|
64
|
+
}
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
if (-not $Version) {
|
|
@@ -127,18 +133,16 @@ Write-Host ""
|
|
|
127
133
|
# 5. PATH
|
|
128
134
|
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
|
129
135
|
if ($UserPath -notlike "*$InstallDir*") {
|
|
130
|
-
Write-Host " [INFO]
|
|
136
|
+
Write-Host " [INFO] Adding to PATH:" -ForegroundColor Yellow
|
|
131
137
|
Write-Host " $InstallDir"
|
|
132
|
-
Write-Host ""
|
|
133
138
|
try {
|
|
134
139
|
$addPath = Read-Host " Add to user PATH now? [Y/n]"
|
|
135
|
-
if ($addPath -eq "" -or $addPath -match "^[Yy]$") {
|
|
136
|
-
[Environment]::SetEnvironmentVariable("Path", "$UserPath;$InstallDir", "User")
|
|
137
|
-
Write-Host " [OK] Added to PATH (restart terminal to take effect)" -ForegroundColor Green
|
|
138
|
-
}
|
|
139
140
|
} catch {
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
$addPath = "Y"
|
|
142
|
+
}
|
|
143
|
+
if ($addPath -eq "" -or $addPath -match "^[Yy]$") {
|
|
144
|
+
[Environment]::SetEnvironmentVariable("Path", "$UserPath;$InstallDir", "User")
|
|
145
|
+
Write-Host " [OK] Added to PATH (restart terminal to take effect)" -ForegroundColor Green
|
|
142
146
|
}
|
|
143
147
|
Write-Host ""
|
|
144
148
|
}
|
|
@@ -155,10 +159,10 @@ Write-Host ""
|
|
|
155
159
|
# 7. Run now
|
|
156
160
|
try {
|
|
157
161
|
$runNow = Read-Host " Run install-helper now? [Y/n]"
|
|
158
|
-
if ($runNow -eq "" -or $runNow -match "^[Yy]$") {
|
|
159
|
-
Write-Host ""
|
|
160
|
-
& $BinaryDest
|
|
161
|
-
}
|
|
162
162
|
} catch {
|
|
163
|
-
|
|
163
|
+
$runNow = "Y"
|
|
164
|
+
}
|
|
165
|
+
if ($runNow -eq "" -or $runNow -match "^[Yy]$") {
|
|
166
|
+
Write-Host ""
|
|
167
|
+
& $BinaryDest
|
|
164
168
|
}
|
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.47",
|
|
4
4
|
"description": "Install Helper - Interactive installer for CANN operator development skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"yaml": "^2.6.0"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@cannbot-ai/install-helper-linux-x64": "0.0.2-beta.
|
|
45
|
-
"@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.
|
|
46
|
-
"@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.
|
|
47
|
-
"@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.
|
|
48
|
-
"@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.
|
|
44
|
+
"@cannbot-ai/install-helper-linux-x64": "0.0.2-beta.47",
|
|
45
|
+
"@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.47",
|
|
46
|
+
"@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.47",
|
|
47
|
+
"@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.47",
|
|
48
|
+
"@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.47"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^22.0.0",
|