mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-27 16:25:36 +00:00
Add a script to update version in all projects
This commit is contained in:
13
UpdateVersion.ps1
Normal file
13
UpdateVersion.ps1
Normal file
@@ -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" '(?<=<Version>)(.*?)(?=</Version>)' $newVersion
|
||||||
|
Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Cli\DiscordChatExporter.Cli.csproj" '(?<=<Version>)(.*?)(?=</Version>)' $newVersion
|
||||||
|
Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Gui\Properties\AssemblyInfo.cs" '(?<=Assembly.*?Version\(")(.*?)(?="\)\])' $newVersion
|
||||||
Reference in New Issue
Block a user