Skip to content

Commit cd45658

Browse files
committed
Work CI-CD
- Add more output to help check progress. - Fix typo. ***NO_CI***
1 parent 9f1a301 commit cd45658

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

azure-pipelines/update-dependencies.ps1

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Write-Debug "Changing working directory to $env:Agent_TempDirectory"
2020
Set-Location "$env:Agent_TempDirectory" | Out-Null
2121

2222
# clone repo and checkout
23-
Write-Debug "Init and featch nf-Visual-Studio-extension repo"
23+
Write-Debug "Init and fetch nf-Visual-Studio-extension repo"
2424

2525
git clone --depth 1 https://github.com/nanoframework/nf-Visual-Studio-extension repo
2626
Set-Location repo | Out-Null
@@ -41,13 +41,27 @@ function Get-LatestNugetVersion {
4141
)
4242
try {
4343
$response = Invoke-RestMethod -Uri $url -Method Get
44-
return $response.versions[-1]
44+
45+
if ($packageTargetVersion -match "preview") {
46+
# Select only versions that include 'preview'
47+
$versions = $response.versions | Where-Object { $_ -match "preview" }
48+
}
49+
else {
50+
# Exclude any version that includes 'preview'
51+
$versions = $response.versions | Where-Object { $_ -notmatch "preview" }
52+
}
53+
54+
Write-Debug "Latest version found: $($versions[-1])"
55+
56+
return $versions[-1]
4557
}
4658
catch {
4759
throw "Error querying NuGet API: $_"
4860
}
4961
}
5062

63+
Write-Host "Target version is: $packageTargetVersion."
64+
5165
$latestNugetVersion = Get-LatestNugetVersion -url $nugetApiUrl
5266

5367
while ($latestNugetVersion -ne $packageTargetVersion) {

0 commit comments

Comments
 (0)