From: Iain Patterson Date: Sat, 28 Dec 2013 16:13:34 +0000 (+0000) Subject: Safer version.h creation. X-Git-Tag: v2.22~110 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=f989c0386e07c741de83724504e9f75d7c25e113;hp=2dcea1bd8f6939c9d894c6e3ba9ed28795c73e38;p=nssm.git Safer version.h creation. Use a temporary file so Visual Studio doesn't detect a timestamp change on the file and trigger a rebuild. --- 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)