From 0c139ab63955675093a5b9a027863cea0519c5d4 Mon Sep 17 00:00:00 2001 From: David Mason Date: Fri, 5 Nov 2021 23:06:47 +0000 Subject: [PATCH] #23 fixed update-versions.cmd --- Scripts/update-versions.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/update-versions.cmd b/Scripts/update-versions.cmd index 41f3866..4d054bb 100644 --- a/Scripts/update-versions.cmd +++ b/Scripts/update-versions.cmd @@ -1,5 +1,5 @@ @echo off -setlocal +setlocal EnableExtensions set return=goto :eof set checkError=if errorlevel 1 goto :error @@ -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} @@ -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