Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions completions/bun.bash
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ _read_scripts_in_package_json() {

# when a script is passed as an option, do not show other scripts as part of the completion anymore
local re_prev_script="(^| )${prev}($| )";
[[
( "${COMPREPLY[*]}" =~ ${re_prev_script} && -n "${COMP_WORDS[2]}" ) || \
( "${COMPREPLY[*]}" =~ ${re_comp_word_script} )
]] && {
[[ "${COMPREPLY[*]}" =~ ${re_prev_script} && -n "${COMP_WORDS[2]}" ]] && {
local re_script=$(echo ${package_json_compreply[@]} | sed 's/[^ ]*/(&)/g');
local new_reply=$(echo "${COMPREPLY[@]}" | sed -E "s/$re_script//");
COMPREPLY=( $(compgen -W "${new_reply}" -- "${cur_word}") );
Expand Down