Skip to content

Commit

Permalink
fix: source completions even if not brew user
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed May 13, 2024
1 parent 949a96b commit 9dce7a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions system_files/shared/usr/etc/profile.d/brew-bash-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BREW_BASH_COMPLETION-}"
if ! test -L /home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew; then
/home/linuxbrew/.linuxbrew/bin/brew completions link > /dev/null
fi
if test -d /home/linuxbrew/.linuxbrew/etc/bash_completion.d; then
for rc in /home/linuxbrew/.linuxbrew/etc/bash_completion.d/*; do
if test -r "$rc"; then
. "$rc"
fi
done
unset rc
fi
fi
if test -d /home/linuxbrew/.linuxbrew/etc/bash_completion.d; then
for rc in /home/linuxbrew/.linuxbrew/etc/bash_completion.d/*; do
if test -r "$rc"; then
. "$rc"
fi
done
unset rc
fi
fi
BREW_BASH_COMPLETION=1
Expand Down
6 changes: 3 additions & 3 deletions system_files/shared/usr/etc/zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
# Brew needs to be loaded before compinit is called
if [[ -o interactive ]] && [[ -d /home/linuxbrew/.linuxbrew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
if [[ -w /home/linuxbrew/.linuxbrew ]]; then
if type brew &>/dev/null; then
if type brew &>/dev/null; then
if [[ -w /home/linuxbrew/.linuxbrew ]]; then
if [[ ! -L "$(brew --prefix)/share/zsh/site-functions/_brew" ]]; then
brew completions link
fi
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
fi

Expand Down

0 comments on commit 9dce7a9

Please sign in to comment.