diff options
author | 2023-03-20 11:27:39 -0700 | |
---|---|---|
committer | 2023-03-20 11:27:39 -0700 | |
commit | 4dd4bab7b97627b6d50a7e7480b051318d82745c (patch) | |
tree | 6314216e62a71c50d4a2f35f1f6d63281bf4f341 | |
parent | 035183eb1294ec8b66aa11f7cb0e8ac7c994fec2 (diff) | |
download | bun-4dd4bab7b97627b6d50a7e7480b051318d82745c.tar.gz bun-4dd4bab7b97627b6d50a7e7480b051318d82745c.tar.zst bun-4dd4bab7b97627b6d50a7e7480b051318d82745c.zip |
Support directories in ZSH run completions (#2425)
* Support scripts in dirs in zsh run completions
* add back wasm support
-rw-r--r-- | completions/bun.zsh | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/completions/bun.zsh b/completions/bun.zsh index 5d1686404..946445b64 100644 --- a/completions/bun.zsh +++ b/completions/bun.zsh @@ -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() { |