Skip to content

Commit eb15e3c

Browse files
committed
add check if we are running in gha or on local env
1 parent ee1bdfb commit eb15e3c

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

install-env.bat

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
@ECHO off
22

3-
SET "PYTHON_REF=https://www.python.org/ftp/python/3.10.4/python-3.10.4-amd64.exe"
4-
SET PYTHON="%ProgramFiles%\Python310\python.exe"
5-
SET PIP="%ProgramFiles%\Python310\Scripts\pip3.exe"
3+
setlocal enableDelayedExpansion
4+
5+
set "PYTHON_REF=https://www.python.org/ftp/python/3.10.4/python-3.10.4-amd64.exe"
6+
set PYTHON="python.exe"
7+
set PIP="pip3.exe"
8+
if "%RUNNER_TOOL_CACHE%"=="" (
9+
echo Running on a local maching builder
10+
set PYTHON="%ProgramFiles%\Python310\python.exe"
11+
)
12+
if "%RUNNER_TOOL_CACHE%"=="" (
13+
set PIP="%ProgramFiles%\Python310\Scripts\pip3.exe"
14+
)
615

716
curl %PYTHON_REF% --output python-install.exe
817
python-install.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 Include_launcher=0
918
%PYTHON% -m pip install --upgrade pip
1019

1120
echo Python version is:
12-
%PYTHON% --version || python --version
21+
%PYTHON% --version
1322

1423
echo PIP version is:
15-
%PIP% --version || pip --version
24+
%PIP% --version

0 commit comments

Comments
 (0)