File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -67,14 +67,23 @@ install_managed_python() {
6767
6868write_python_shim () {
6969 local shim_path=" $1 "
70- local shim_name=" $2 "
71- local managed_python_relative=" ${PYTHON_BIN# " $BUILD_DIR " / } "
70+ local python_executable_name
71+
72+ python_executable_name=" $( basename " $PYTHON_BIN " ) "
7273
7374 cat > " $shim_path " << EOF
7475#!/usr/bin/env bash
7576set -euo pipefail
7677APP_DIR="\$ (cd "\$ (dirname "\$ {BASH_SOURCE[0]}")/../.." && pwd)"
77- exec "\$ APP_DIR/$managed_python_relative " "\$ @"
78+
79+ for candidate in "\$ APP_DIR"/.uv/python/*/bin/${python_executable_name} ; do
80+ if [ -x "\$ candidate" ]; then
81+ exec "\$ candidate" "\$ @"
82+ fi
83+ done
84+
85+ echo "Managed Python executable not found for ${python_executable_name} under \$ APP_DIR/.uv/python" >&2
86+ exit 1
7887EOF
7988 chmod +x " $shim_path "
8089}
You can’t perform that action at this time.
0 commit comments