@cannbot-ai/install-helper 0.0.2-beta.61 → 0.0.2-beta.63

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 CHANGED
@@ -15,6 +15,18 @@ try {
15
15
 
16
16
  $ErrorActionPreference = "Stop"
17
17
 
18
+ function Compare-SemVer($a, $b) {
19
+ $aParts = $a -split '-',2
20
+ $bParts = $b -split '-',2
21
+ try { $aVer = [version]$aParts[0] } catch { return $false }
22
+ try { $bVer = [version]$bParts[0] } catch { return $false }
23
+ if ($aVer -ne $bVer) { return $aVer -gt $bVer }
24
+ if ($aParts.Length -eq 1 -and $bParts.Length -eq 1) { return $false }
25
+ if ($aParts.Length -eq 1) { return $true }
26
+ if ($bParts.Length -eq 1) { return $false }
27
+ return "$($aParts[1])" -gt "$($bParts[1])"
28
+ }
29
+
18
30
  Write-Host ""
19
31
  Write-Host " ____ _ _ _ _ _ ____ _ " -ForegroundColor Cyan
20
32
  Write-Host " / ___| / \ | \ | | \ | | __ ) ___ | |_ " -ForegroundColor Cyan
@@ -51,7 +63,7 @@ foreach ($url in $Mirrors) {
51
63
  if (-not $Version) {
52
64
  $Version = $resp.version
53
65
  $Registry = $url
54
- } elseif ($resp.version -gt $Version) {
66
+ } elseif (Compare-SemVer $resp.version $Version) {
55
67
  $Version = $resp.version
56
68
  $Registry = $url
57
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cannbot-ai/install-helper",
3
- "version": "0.0.2-beta.61",
3
+ "version": "0.0.2-beta.63",
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.61",
46
- "@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.61",
47
- "@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.61",
48
- "@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.61",
49
- "@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.61"
45
+ "@cannbot-ai/install-helper-linux-x64": "0.0.2-beta.63",
46
+ "@cannbot-ai/install-helper-linux-arm64": "0.0.2-beta.63",
47
+ "@cannbot-ai/install-helper-darwin-x64": "0.0.2-beta.63",
48
+ "@cannbot-ai/install-helper-darwin-arm64": "0.0.2-beta.63",
49
+ "@cannbot-ai/install-helper-windows-x64": "0.0.2-beta.63"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.0.0",