Skip to content
Open
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
19 changes: 11 additions & 8 deletions yarn-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -1015,14 +1015,17 @@ _yarn_yarn() {
}

_yarn() {
# shellcheck disable=SC2064
trap "
PWD=$PWD
$(shopt -p extglob)
set +o pipefail
" RETURN

shopt -s extglob
if [[ "$SHELL" != "/bin/zsh" && "$SHELL" != "/usr/bin/zsh" ]]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if zsh is installed in a non-standard path? Like if installed by homebrew or something? Is there a more reliable way of determining this?

Or perhaps instead of making this a check of the negative ("this shell is not zsh"), maybe it would be better to make this a check of the affirmative ("this shell is bash").

# shellcheck disable=SC2064
trap "
PWD=$PWD
$(shopt -p extglob)
set +o pipefail
" RETURN

shopt -s extglob
fi

set -o pipefail

declare cur cmd prev
Expand Down