Add uv to the list of possible python runners
I'm one of the rare cases that does have uv, but doesn't have python installed globally
This commit is contained in:
parent
c4dc07385e
commit
fd023cb122
1 changed files with 10 additions and 7 deletions
17
x
17
x
|
|
@ -29,16 +29,19 @@ xpy=$(dirname "$(realpath "$0")")/x.py
|
||||||
# On MacOS, `py` tries to install "Developer command line tools". Try `python3` first.
|
# On MacOS, `py` tries to install "Developer command line tools". Try `python3` first.
|
||||||
# NOTE: running `bash -c ./x` from Windows doesn't set OSTYPE.
|
# NOTE: running `bash -c ./x` from Windows doesn't set OSTYPE.
|
||||||
case ${OSTYPE:-} in
|
case ${OSTYPE:-} in
|
||||||
cygwin*|msys*) SEARCH="py python3 python python2";;
|
cygwin*|msys*) SEARCH="py python3 python python2 uv";;
|
||||||
*) SEARCH="python3 python py python2";;
|
*) SEARCH="python3 python py python2 uv";;
|
||||||
esac
|
esac
|
||||||
for SEARCH_PYTHON in $SEARCH; do
|
for SEARCH_PYTHON in $SEARCH; do
|
||||||
if python=$(command -v $SEARCH_PYTHON) && [ -x "$python" ]; then
|
if python=$(command -v $SEARCH_PYTHON) && [ -x "$python" ]; then
|
||||||
if [ $SEARCH_PYTHON = py ]; then
|
case $SEARCH_PYTHON in
|
||||||
extra_arg="-3"
|
py)
|
||||||
else
|
extra_arg="-3";;
|
||||||
extra_arg=""
|
uv)
|
||||||
fi
|
extra_arg="run";;
|
||||||
|
*)
|
||||||
|
extra_arg="";;
|
||||||
|
esac
|
||||||
exec "$python" $extra_arg "$xpy" "$@"
|
exec "$python" $extra_arg "$xpy" "$@"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue