Skip to content

Commit

Permalink
Update test-example.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisherAmonulloev committed Nov 24, 2024
1 parent 3fdcffa commit 0ebd26d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test-example.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
param (
[string]$version = "latest"
)
$global:build = $env:buildVersion -ne $null ? $env:buildVersion : $version

Write-Host "Build: $build"
if (-not $env:buildVersion) {
$global:buildVersion = "latest"
} else {
$global:buildVersion = $env:buildVersion
}
Write-Host "Build: $buildVersion"
$global:errorCode = 0

function Process-JavaScriptProjects {
Expand All @@ -30,7 +33,7 @@ function Process-JavaScriptProjects {

Write-Host "`nUpdating packages..."
foreach ($package in $($folder.Packages)) {
$command = "npm install $package@$global:build --save"
$command = "npm install $package@$global:buildVersion --save"
Write-Output "Running: $command"
Invoke-Expression $command
}
Expand Down Expand Up @@ -81,7 +84,7 @@ function Process-DotNetProjects {
}
}

Write-Host "Version: $version"
Write-Host "Version: $buildVersion"
Process-JavaScriptProjects
Process-DotNetProjects

Expand Down

0 comments on commit 0ebd26d

Please sign in to comment.