# HG changeset patch # User Ludovic Chabant # Date 1418677204 28800 # Node ID 0c67b56abc638515fbe9f5e9137828293577af7e # Parent 186b65facdb10dc4aee0d2fec70fe5d42db66276 Attempt at better error handling with the Windows update script. * Use `call` to run Ctags because apparently, the way Vim runs background Windows scripts means the whole thing will abort if there's an error. But here we want to keep going so we get a chance to unlock the tags file if possible. * Add some `ERRORLEVEL` handling code. * Log more stuff to the log file. diff -r 186b65facdb1 -r 0c67b56abc63 plat/win32/update_tags.cmd --- a/plat/win32/update_tags.cmd Mon Dec 15 12:57:54 2014 -0800 +++ b/plat/win32/update_tags.cmd Mon Dec 15 13:00:04 2014 -0800 @@ -83,15 +83,27 @@ ) echo Running ctags >> %LOG_FILE% -echo "%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% %PROJECT_ROOT% >> %LOG_FILE% -"%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% %PROJECT_ROOT% +echo call "%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% %PROJECT_ROOT% >> %LOG_FILE% +call "%CTAGS_EXE%" -R -f "%TAGS_FILE%.temp" %CTAGS_ARGS% %PROJECT_ROOT% >> %LOG_FILE% 2>&1 +if ERRORLEVEL 1 ( + echo ERROR: Ctags executable returned non-zero code. >> %LOG_FILE% + goto :Unlock +) echo Replacing tags file >> %LOG_FILE% echo move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE% -move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >NUL 2>&1 +move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE% 2>&1 +if ERRORLEVEL 1 ( + echo ERROR: Unable to rename temp tags file into actual tags file. >> %LOG_FILE% + goto :Unlock +) +:Unlock echo Unlocking tags file... >> %LOG_FILE% del /F "%TAGS_FILE%.lock" +if ERRORLEVEL 1 ( + echo ERROR: Unable to remove file lock. >> %LOG_FILE% +) echo Done. >> %LOG_FILE% if [%PAUSE_BEFORE_EXIT%]==[1] (