From f989c0386e07c741de83724504e9f75d7c25e113 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Sat, 28 Dec 2013 16:13:34 +0000 Subject: [PATCH] Safer version.h creation. Use a temporary file so Visual Studio doesn't detect a timestamp change on the file and trigger a rebuild. --- version.cmd | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/version.cmd b/version.cmd index 77045c9..d9ce5d7 100644 --- a/version.cmd +++ b/version.cmd @@ -40,8 +40,11 @@ if "%BUILD_ID%" == "" (set year=) else ( ) @rem Create version.h. -@echo>version.h #define NSSM_VERSION _T("%description%") -@echo>>version.h #define NSSM_VERSIONINFO %major%,%minor%,%n%,%BUILD_NUMBER% -@echo>>version.h #define NSSM_DATE _T("%DATE%") -@echo>>version.h #define NSSM_FILEFLAGS %flags% -@echo>>version.h #define NSSM_COPYRIGHT _T("(c) 2003-%year% Iain Patterson") +@echo>version.h.new #define NSSM_VERSION _T("%description%") +@echo>>version.h.new #define NSSM_VERSIONINFO %major%,%minor%,%n%,%BUILD_NUMBER% +@echo>>version.h.new #define NSSM_DATE _T("%DATE%") +@echo>>version.h.new #define NSSM_FILEFLAGS %flags% +@echo>>version.h.new #define NSSM_COPYRIGHT _T("(c) 2003-%year% Iain Patterson") + +fc version.h version.h.new >NUL: 2>NUL: +if %ERRORLEVEL% == 0 (del version.h.new) else (move /y version.h.new version.h) -- 2.7.4