Skip to content

Commit

Permalink
Refactor define_latest_genie_python
Browse files Browse the repository at this point in the history
  • Loading branch information
jackbdoughty committed Aug 30, 2024
1 parent c30e1a9 commit 6c7a36b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions installation_and_upgrade/define_latest_genie_python.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@echo off
setlocal enabledelayedexpansion
REM Get latest python build and kits icp path
REM KITS_ICP_PATH is set to ICP directory
REM LATEST_PYTHON is set to a version on genie_python that can be run
Expand All @@ -15,19 +14,8 @@ if exist "%genie_dir%\LATEST_BUILD.txt" (

for /f %%i in ( %genie_dir%\LATEST_BUILD.txt ) do (

if "%~1" NEQ "" (
set "LATEST_PYTHON_DIR=%~1\Python_Build_%%i"
) else (
set "LATEST_PYTHON_DIR=%tmp%\Python_Build_%%i"
)
set PYTHON_BUILD_NO=%%i

mkdir !LATEST_PYTHON_DIR!

%genie_dir%\BUILD-%%i\genie_python_install.bat !LATEST_PYTHON_DIR!

set "LATEST_PYTHON=!LATEST_PYTHON_DIR!\python.exe"
set "LATEST_PYTHON3=!LATEST_PYTHON_DIR!\python3.exe"

)

) else (
Expand All @@ -37,6 +25,19 @@ if exist "%genie_dir%\LATEST_BUILD.txt" (

)

if "%~1" NEQ "" (
set "LATEST_PYTHON_DIR=%~1\Python_Build_%PYTHON_BUILD_NO%"
) else (
set "LATEST_PYTHON_DIR=%tmp%\Python_Build_%PYTHON_BUILD_NO%"
)

mkdir %LATEST_PYTHON_DIR%

%genie_dir%\BUILD-%PYTHON_BUILD_NO%\genie_python_install.bat %LATEST_PYTHON_DIR%

set "LATEST_PYTHON=%LATEST_PYTHON_DIR%\python.exe"
set "LATEST_PYTHON3=%LATEST_PYTHON_DIR%\python3.exe"

rem @echo LATEST PYTHON: %LATEST_PYTHON%

exit /b 0
Expand Down

0 comments on commit 6c7a36b

Please sign in to comment.