1
+ $ScriptPath = $MyInvocation.MyCommand.Path | Split-Path
2
+ Set-Location " $ScriptPath "
3
+
4
+ $AsciiEncoding = New-Object System.Text.ASCIIEncoding
5
+
6
+ Write-Host - NoNewLine " Current version: "
7
+ Get-Content " Toastify\version"
8
+ $NewVersion = Read-Host - Prompt " New version"
9
+
10
+ Write-Host
11
+
12
+ Write-Host " Update: InstallationScript\Install.nsi"
13
+ $FilePath = [System.IO.Path ]::GetFullPath((Join-Path (pwd) " InstallationScript\Install.nsi" ))
14
+ $Lines = (Get-Content ' InstallationScript\Install.nsi' ) -replace ' ("(Display)?Version") ".*"' , " `$ 1 `" $NewVersion `" "
15
+ [System.IO.File ]::WriteAllLines($FilePath , $Lines )
16
+
17
+ Write-Host " Update: Toastify\version"
18
+ $FilePath = [System.IO.Path ]::GetFullPath((Join-Path (pwd) " Toastify\version" ))
19
+ $Lines = " $NewVersion "
20
+ [System.IO.File ]::WriteAllText($FilePath , $Lines , $AsciiEncoding )
21
+
22
+ Write-Host " Update: Toastify\Properties\AssemblyInfo.cs"
23
+ $FilePath = [System.IO.Path ]::GetFullPath((Join-Path (pwd) " Toastify\Properties\AssemblyInfo.cs" ))
24
+ $Lines = (Get-Content ' Toastify\Properties\AssemblyInfo.cs' ) -replace ' ^\[(assembly: AssemblyVersion)\(".*"\)\]$' , " [`$ 1(`" $NewVersion .*`" )]"
25
+ [System.IO.File ]::WriteAllLines($FilePath , $Lines )
26
+
27
+ Write-Host " Update: ToastifyAPI\Properties\AssemblyInfo.cs"
28
+ $FilePath = [System.IO.Path ]::GetFullPath((Join-Path (pwd) " ToastifyAPI\Properties\AssemblyInfo.cs" ))
29
+ $Lines = (Get-Content ' ToastifyAPI\Properties\AssemblyInfo.cs' ) -replace ' ^\[(assembly: AssemblyVersion)\(".*"\)\]$' , " [`$ 1(`" $NewVersion .*`" )]"
30
+ [System.IO.File ]::WriteAllLines($FilePath , $Lines )
31
+
32
+ Write-Host " Press any key to continue ..."
33
+ $x = $Host.UI.RawUI.ReadKey (" NoEcho,IncludeKeyDown" )
0 commit comments