Skip to content

Commit

Permalink
Select the greater Python version available (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansjhenry authored Feb 19, 2024
1 parent d1385dd commit 8e819c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
strategy:
matrix:
# scade-version: ['23.1', '23.2']
scade-version: ['23.1']
scade-version: ['23.2']
fail-fast: false
steps:
- name: Checkout
Expand Down
11 changes: 10 additions & 1 deletion get-scade-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,17 @@ runs:
shell: cmd
run: |
:: Retrieve Python name/directory
setlocal ENABLEDELAYEDEXPANSION
echo Get Python interpreter for "%INPUT_SCADE_DIR%"
for /f "usebackq" %%A in (`dir /B "%INPUT_SCADE_DIR%\contrib\Python*"`) do (set PYTHON_NAME=%%A)
set PYTHON_VERSION=0
for /f "usebackq" %%A in (`dir /B "%INPUT_SCADE_DIR%\contrib\Python*"`) do (
set CURRENT_VERSION=%%A
set CURRENT_VERSION=!CURRENT_VERSION:Python=%!
if !CURRENT_VERSION! GTR !PYTHON_VERSION! (
set PYTHON_VERSION=!CURRENT_VERSION!
)
)
set PYTHON_NAME=Python%PYTHON_VERSION%
echo Python name="%PYTHON_NAME%"
echo python-name=%PYTHON_NAME%>> %GITHUB_OUTPUT%
set PYTHON_DIR=%INPUT_SCADE_DIR%\contrib\%PYTHON_NAME%
Expand Down

0 comments on commit 8e819c1

Please sign in to comment.