mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Add better python discovery
`x.ps1` and `x` will now search for python executables like `python3.9` and `python3.10.exe`
This commit is contained in:
@@ -29,5 +29,11 @@ for SEARCH_PYTHON in py python3 python python2; do
|
||||
exec "$python" $extra_arg "$xpy" "$@"
|
||||
fi
|
||||
done
|
||||
|
||||
python=$(bash -c "compgen -c python" | grep '^python[2-3]\.[0-9]\+$' | head -n1)
|
||||
if ! [ "$python" = "" ]; then
|
||||
exec "$python" "$xpy" "$@"
|
||||
fi
|
||||
|
||||
echo "$0: error: did not find python installed" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user