feature: add a python-path output

Expose a `python-path` output containing the chosen Python executable path.
This commit is contained in:
mayeut committed 2022-05-24 21:02:03 +02:00
1 parent fff15a21cc
commit ff706563d7
9 files changed
+84 -4

No files matched your search

+14
View 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}"