Browse Source

trying more

pull/2430/head
Rox0z 3 months ago
parent
commit
c2ca45156b
2 changed files with 20 additions and 0 deletions
  1. 15
      setup.bat
  2. 5
      setup.sh

15
setup.bat

@ -45,11 +45,26 @@ if %ERRORLEVEL% equ 0 (
)
)
)
if "!PYTHON_CMD!" == "" (
where python3 >nul 2>&1
if %ERRORLEVEL% equ 0 (
for /f "tokens=*" %%i in ('python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"') do (
set PY_VERSION=%%i
if "!PY_VERSION!" == "3.10" (
set PYTHON_CMD=python3
) else if "!PY_VERSION!" == "3.9" (
set PYTHON_CMD=python3
)
)
)
)
)
)
if "%PYTHON_CMD%" == "" (
echo Error: Python 3.9 or 3.10 is not installed or not in PATH
echo Checked commands: python3.10, python3.9, python, python3
echo Please install Python 3.9 or 3.10: https://www.python.org/downloads/
exit /b 1
)

5
setup.sh

@ -31,6 +31,11 @@ elif command -v python3 &> /dev/null; then
if [[ "$PY_VERSION" == "3.10" || "$PY_VERSION" == "3.9" ]]; then
PYTHON_CMD="python3"
fi
elif command -v python &> /dev/null; then
PY_VERSION=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
if [[ "$PY_VERSION" == "3.10" || "$PY_VERSION" == "3.9" ]]; then
PYTHON_CMD="python"
fi
fi
if [ -z "$PYTHON_CMD" ]; then

Loading…
Cancel
Save