From 0b149523466b555cad70f2b514c96d325fad166f Mon Sep 17 00:00:00 2001 From: Oleksii Holub Date: Mon, 5 Nov 2018 13:31:42 +0200 Subject: [PATCH] Add a script to update version in all projects --- UpdateVersion.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 UpdateVersion.ps1 diff --git a/UpdateVersion.ps1 b/UpdateVersion.ps1 new file mode 100644 index 0000000..1eb7f76 --- /dev/null +++ b/UpdateVersion.ps1 @@ -0,0 +1,13 @@ +param([string] $newVersion) + +function Replace-TextInFile { + param([string] $filePath, [string] $pattern, [string] $replacement) + + $content = [System.IO.File]::ReadAllText($filePath) + $content = [System.Text.RegularExpressions.Regex]::Replace($content, $pattern, $replacement) + [System.IO.File]::WriteAllText($filePath, $content) +} + +Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Core\DiscordChatExporter.Core.csproj" '(?<=)(.*?)(?=)' $newVersion +Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Cli\DiscordChatExporter.Cli.csproj" '(?<=)(.*?)(?=)' $newVersion +Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Gui\Properties\AssemblyInfo.cs" '(?<=Assembly.*?Version\(")(.*?)(?="\)\])' $newVersion \ No newline at end of file