Add __fish_anypython helper function

This just finds the first usable python and echos it, so it can then
be used.

We have a few places where we use it and I'm about to add some more.
This commit is contained in:
Fabian Homborg
2019-03-09 17:57:49 +01:00
parent 3ac1c29f79
commit 9b1fb6938e
3 changed files with 14 additions and 12 deletions

View File

@@ -0,0 +1,10 @@
function __fish_anypython
# Try python3 first, because that's usually faster and generally nicer.
for py in python3 python2 python
command -sq $py
and echo $py
and return 0
end
# We have no python.
return 1
end