Skip to content

Commit

Permalink
completions/django: Check Existence of binary
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 16, 2023
1 parent 116200c commit ca98583
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions completions/django.completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,16 @@ function _omb_completion_django_python {

function _omb_completion_django_init {
# Support for multiple interpreters.
local -a pythons=()
local -a pythons=(python)
if _omb_util_command_exists whereis; then
local python_interpreters
_omb_util_split python_interpreters "$(whereis python | cut -d " " -f 2-)"
local python
for python in "${python_interpreters[@]}"; do
[[ -x $python ]] || continue
pythons+=("$(basename -- "$python")")
done
_omb_util_split pythons "$(printf '%s\n' "${pythons[@]}" | sort -u)" $'\n'
else
pythons=(python)
fi

complete -F _omb_completion_django_python -o default "${pythons[@]}"
Expand Down

0 comments on commit ca98583

Please sign in to comment.