mirror of
https://github.com/actions/setup-python.git
synced 2024-11-13 19:09:22 -05:00
ff706563d7
Expose a `python-path` output containing the chosen Python executable path.
14 lines
461 B
Bash
Executable file
14 lines
461 B
Bash
Executable file
#!/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}"
|