Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#23 fixed update-versions.cmd #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Scripts/update-versions.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
setlocal
setlocal EnableExtensions
set return=goto :eof
set checkError=if errorlevel 1 goto :error

Expand All @@ -12,7 +12,7 @@ call :getNewVersion newVersion
set newVersionCommas=%newVersion:.=,%

rem Non-optimal regexes: useful characters for OR, lookbehind and " are troublesome in batch scripting
set versionNumberRegex=\d+(?:\.\d+){3}
set versionNumberRegex=\d+(?:\.\d+){2,3}
set assemblyVersionRegex=(Assembly(?:File)?Version(?:Attribute)?\(.)%versionNumberRegex%
set assemblyVersionReplacement=${1}%newVersion%
set rcVersionInfoRegex=((?:[FILEPRODUCT]+)VERSION\s+)\d+(?:,\d+){3}
Expand Down Expand Up @@ -72,7 +72,7 @@ rem %3 replacement pattern
rem %4 output encoding
set tempFile=%temp%\olewoo.tmp
powershell (Get-Content -path "%~1" -Raw -Encoding utf8) -replace '%~2','%~3' ^| out-file "%tempFile%" -encoding %~4 -NoNewline
if errorlevel 1 exit /b 1
if %errorlevel% NEQ 0 exit /b 1

copy "%tempFile%" "%~1" > nul
if errorlevel 1 exit /b 1
Expand Down