From 164a00e35e31182bfb2c8dca0dacfce0b478d957 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Tue, 20 Oct 2020 00:04:07 -0400 Subject: [PATCH] update version line by line to see if it will stop adding newlines --- update-versions.ps1 | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/update-versions.ps1 b/update-versions.ps1 index 8740f5b8..d05e3818 100644 --- a/update-versions.ps1 +++ b/update-versions.ps1 @@ -2,10 +2,30 @@ echo "Obtaining version information from .\version" $v=(Get-Content -Path .\version) echo " version: $v" echo "" + +rm temp.cs -ErrorAction Ignore +rm temp.aip -ErrorAction Ignore + $assemblyInfo="./DesktopEdge/Properties/AssemblyInfo.cs" echo "Replacing version in $assemblyInfo" -(Get-Content -Encoding UTF8 -path $assemblyInfo -Raw) -replace '\d\.\d\.\d\.', "$v." | Set-Content -Path $assemblyInfo -Encoding UTF8 -NoNewline +foreach($line in Get-Content $assemblyInfo) { + $l = $line -replace '\d*.\d*.\d*.0', "${v}.0" + echo $l >> temp.cs +} + +echo "copying temp.cs into $assemblyInfo" +rm $assemblyInfo +mv temp.cs $assemblyInfo +#(Get-Content -Encoding UTF8 -path $assemblyInfo -Raw) -replace '\d*.\d*.\d*.0', "${v}.0" | Set-Content -Path $assemblyInfo -Encoding UTF8 -NoNewline $installer="./Installer/ZitiDesktopEdge.aip" -echo "Replacing version in $installer" -(Get-Content -Encoding UTF8 -path $installer -Raw) -replace '"ProductVersion" Value="\d\.\d\.\d"', """ProductVersion"" Value=""${v}""" | Set-Content -Path $installer -Encoding UTF8 -NoNewline +echo "Replacing version in $installer into temp.aip" +foreach($line in Get-Content $installer) { + $l = $line -replace '"ProductVersion" Value="\d*\.\d*\.\d*"', """ProductVersion"" Value=""${v}""" + echo $l >> temp.aip +} + +echo "copying temp.aip into $installer" +rm $installer +mv temp.aip $installer +#(Get-Content -Encoding UTF8 -path $installer -Raw) -replace '"ProductVersion" Value="\d\.\d\.\d"', """ProductVersion"" Value=""${v}""" | Set-Content -Path $installer -Encoding UTF8 -NoNewline