forked from aliencube/Microsoft-ADAL-Wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapply-version.ps1
More file actions
26 lines (20 loc) · 736 Bytes
/
Copy pathapply-version.ps1
File metadata and controls
26 lines (20 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This script update version.
Param(
[string] [Parameter(Mandatory=$true)] $Version
)
$exitCode = 0
$projects = Get-ChildItem .\src | ?{$_.PsIsContainer}
foreach($project in $projects)
{
$projectPath = $project.FullName
$projectName = $project.Name
Write-Host "Updating version of $projectName to $Version ..." -ForegroundColor Green
$projectJson = Get-Content -Path $projectPath\project.json | ConvertFrom-Json
$projectJson.version = $Version
$projectJson | ConvertTo-Json -Depth 999 | Out-File -FilePath $projectPath\project.json -Encoding utf8
Write-Host "Updating version of $projectName to $Version success" -ForegroundColor Green
$exitCode += $LASTEXITCODE
}
if($exitCode -ne 0) {
$host.SetShouldExit($exitCode)
}