Support directories in ZSH run completions (#2425)

* Support scripts in dirs in zsh run completions

* add back wasm support
This commit is contained in:
Jackson Kearl
2023-03-20 11:27:39 -07:00
committed by GitHub
parent 035183eb12
commit 4dd4bab7b9

View File

@@ -635,24 +635,11 @@ _bun() {
_bun_run_param_script_completion() {
local -a scripts_list
IFS=$'\n' scripts_list=($(SHELL=zsh bun getcompletes s))
scripts="scripts:scripts:(($scripts_list))"
IFS=$'\n' bunjs=($(SHELL=zsh bun getcompletes j))
IFS=$'\n' bins=($(SHELL=zsh bun getcompletes b))
if [ -n "$bunjs" ] && [ "$bunjs" != " " ]; then
if [ -n "$bins" ] && [ "$bins" != " " ]; then
_alternative $scripts "files:files:(($bunjs))" "bin:bin:(($bins))"
return 1
fi
_alternative $scripts "args:Bun.js:(($bunjs))"
fi
if [ -n "$bins" ] && [ "$bins" != " " ]; then
_alternative $scripts "args:bin:(($bins))"
return 1
fi
_alternative "scripts:scripts:(($scripts_list))"
_alternative "bin:bin:(($bins))"
_alternative "files:file:_files -g '*.(js|ts|jsx|tsx|wasm)'"
}
_set_remove() {