Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes genie python install variables #208

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions installation_and_upgrade/define_latest_genie_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ if "%~1" NEQ "" (

mkdir %LATEST_PYTHON_DIR%

%genie_dir%\BUILD-%PYTHON_BUILD_NO%\genie_python_install.bat %LATEST_PYTHON_DIR%
CALL %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

:ERROR
Expand Down
33 changes: 21 additions & 12 deletions installation_and_upgrade/remove_genie_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,35 @@ if "%~1"=="" (
goto ERROR
)

set substring=Python_Build_
set path=%~1
set modified_path=%path:%substring%=%
set remove_genie_python_path=%~1

if "%path%" neq "%modified_path%" (
REM Checks that supplied filepath exists.
if exist %remove_genie_python_path% (

RMDIR /S /Q %path%
REM Checks that "Python_Build_" is in the supplied filepath, so it is a python build.
echo.%remove_genie_python_path% | findstr /C:"Python_Build_">nul && (

set LATEST_PYTHON_DIR=
set LATEST_PYTHON=
set LATEST_PYTHON3=
REM Deletes directory tree + quiet.
RMDIR /S /Q %remove_genie_python_path%

REM Unassigns environment variables.
set LATEST_PYTHON_DIR=
set LATEST_PYTHON=
set LATEST_PYTHON3=

@echo Successfully removed "%remove_genie_python_path%" and unset genie build variables.
exit /b 0

) || (
@echo "%remove_genie_python_path%" is not a python build directory.
goto ERROR
)

) else (
@echo Could not find the specified path: %path%.
@echo Could not find the specified path: "%remove_genie_python_path%".
goto ERROR
)

@echo Successfully removed %path% and unset genie build variables.
exit /b 0

:ERROR
@echo remove_genie_python failed
exit /b 1