-
Notifications
You must be signed in to change notification settings - Fork 7
/
set-version.ps1
23 lines (19 loc) · 940 Bytes
/
set-version.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[CmdletBinding()]
param($newVersion)
$xml=New-Object XML
$xml.Load("Directory.Build.props")
$versionNode = $xml.Project.PropertyGroup.Version
if ($null -eq $versionNode)
{
$versionNode = $xml.CreateElement("Version")
$xml.Project.PropertyGroup.AppendChild($versionNode)
Write-Host "Version XML tag added to the csproj"
}
$xml.Project.PropertyGroup.Version = $newVersion
$xml.Save("Directory.Build.props")
$content = [System.IO.File]::ReadAllText("setup/Linux/control-amd64").Replace("{version}",$newVersion)
[System.IO.File]::WriteAllText("setup/Linux/control-amd64", $content)
$content = [System.IO.File]::ReadAllText("setup/Linux/control-armhf").Replace("{version}",$newVersion)
[System.IO.File]::WriteAllText("setup/Linux/control-armhf", $content)
$content = [System.IO.File]::ReadAllText("setup/Linux/control-arm64").Replace("{version}",$newVersion)
[System.IO.File]::WriteAllText("setup/Linux/control-arm64", $content)