about summary refs log tree commit diff
path: root/x
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2022-10-13 10:20:39 +0200
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2022-10-31 08:33:24 +0100
commitc83ddaef948e5aadf3e64169dd3ab4268834fbff (patch)
treefd04346a5e9a8dc8af7516a47b0b13d1e89dedad /x
parent4596f4f8b565bdd02d3b99d1ab12ff09146a93de (diff)
downloadrust-c83ddaef948e5aadf3e64169dd3ab4268834fbff.tar.gz
rust-c83ddaef948e5aadf3e64169dd3ab4268834fbff.zip
Add better python discovery
`x.ps1` and `x` will now search for python executables like `python3.9`
and `python3.10.exe`
Diffstat (limited to 'x')
-rwxr-xr-xx6
1 files changed, 6 insertions, 0 deletions
diff --git a/x b/x
index 704d0f791f3..4309b82627c 100755
--- a/x
+++ b/x
@@ -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