fix: let's just try to find a version inside the version string

This commit is contained in:
Bjarke Sporring
2026-01-15 09:55:54 +01:00
parent 91c46718c6
commit 32a0e89f72

View File

@@ -131,7 +131,7 @@ function Install-Package {
if ($MinVersion -and $version) { if ($MinVersion -and $version) {
# Extract semantic version numbers only - stop before any non-digit/non-dot characters # Extract semantic version numbers only - stop before any non-digit/non-dot characters
# This extracts "2.52.0" from "2.52.0.windows.1" # This extracts "2.52.0" from "2.52.0.windows.1"
if ($version -match '^(\d+)(?:\.(\d+))?(?:\.(\d+))?') { if ($version -match '(\d+)(?:\.(\d+))?(?:\.(\d+))?') {
$installedVersion = $matches[1] $installedVersion = $matches[1]
try { try {
if ([version]$installedVersion -lt [version]$MinVersion) { if ([version]$installedVersion -lt [version]$MinVersion) {
@@ -619,7 +619,6 @@ Write-Host " code --version" -ForegroundColor White
Write-Success "Repository cloned successfully!" Write-Success "Repository cloned successfully!"
} }
# Open in VSCode
Write-Host " Opening in VSCode..." -ForegroundColor Cyan Write-Host " Opening in VSCode..." -ForegroundColor Cyan
if (Get-Command code -ErrorAction SilentlyContinue) { if (Get-Command code -ErrorAction SilentlyContinue) {
& code $workshopPath & code $workshopPath