From b450ea262e7177788b7a66d268c04a5f7be61793 Mon Sep 17 00:00:00 2001 From: Jack Doughty Date: Fri, 25 Oct 2024 17:25:45 +0100 Subject: [PATCH] Covered empty file case --- .../define_latest_genie_python.bat | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/installation_and_upgrade/define_latest_genie_python.bat b/installation_and_upgrade/define_latest_genie_python.bat index 002c3e6..25b7d1d 100644 --- a/installation_and_upgrade/define_latest_genie_python.bat +++ b/installation_and_upgrade/define_latest_genie_python.bat @@ -7,22 +7,25 @@ REM Fetch newest python build from \\isis\inst$\Kits$\CompGroup\ICP\genie_python REM Use genie_python_install to install it into a temporary directory REM Need to make sure that after every use of this bat that these variables are undefined and the temp dir is removed + set "KITS_ICP_PATH=\\isis.cclrc.ac.uk\inst$\Kits$\CompGroup\ICP" set "genie_dir=%KITS_ICP_PATH%\genie_python_3" +set "latest_build_file=%genie_dir%\LATEST_BUILD.txt" -if exist "%genie_dir%\LATEST_BUILD.txt" ( +set "PYTHON_BUILD_NO=" +if exist "%genie_dir%\LATEST_BUILD.txt" ( for /f %%i in ( %genie_dir%\LATEST_BUILD.txt ) do ( - set PYTHON_BUILD_NO=%%i - ) - ) else ( - @echo Could not access LATEST_BUILD.txt goto ERROR - +) + +if "%PYTHON_BUILD_NO%" == "" ( + @echo invalid LATEST_BUILD.txt + goto ERROR ) if "%~1" NEQ "" (