mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-08 12:28:20 +02:00
feature: add a python-path
output
Expose a `python-path` output containing the chosen Python executable path.
This commit is contained in:
parent
fff15a21cc
commit
ff706563d7
9 changed files with 84 additions and 4 deletions
14
__tests__/check-python-path.sh
Executable file
14
__tests__/check-python-path.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PYTHON_PATH="$1"
|
||||
PATH_EXECUTABLE=$(python -c 'import sys; print(sys.executable)')
|
||||
PYTHON_PATH_EXECUTABLE=$("${PYTHON_PATH}" -c 'import sys; print(sys.executable)')
|
||||
if [ "${PATH_EXECUTABLE}" != "${PYTHON_PATH_EXECUTABLE}" ]; then
|
||||
echo "Executable mismatch."
|
||||
echo "python in PATH is: ${PATH_EXECUTABLE}"
|
||||
echo "python-path (${PYTHON_PATH}) is: ${PYTHON_PATH_EXECUTABLE}"
|
||||
exit 1
|
||||
fi
|
||||
echo "python-path: ${PYTHON_PATH}"
|
Loading…
Add table
Add a link
Reference in a new issue