mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
fix(completions/django): Check Existence of binary
This commit is contained in:
@@ -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[@]}"
|
||||
|
Reference in New Issue
Block a user