Reduce subshell forks with variable
By following the established pattern in https://github.com/Bash-it/bash-it/blob/master/completion/available/system.completion.bash#L17-L22 we can reduce the amount of `fork` calls that are made. Signed-off-by: Mike Fiedler <miketheman@gmail.com>pull/1048/head
parent
cbe63e8871
commit
23da5508cc
|
|
@ -1,9 +1,11 @@
|
||||||
if which brew >/dev/null 2>&1; then
|
if which brew >/dev/null 2>&1; then
|
||||||
if [ -f `brew --prefix`/etc/bash_completion.d/brew ]; then
|
BREW_PREFIX=$(brew --prefix)
|
||||||
. `brew --prefix`/etc/bash_completion.d/brew
|
|
||||||
|
if [ -f "$BREW_PREFIX"/etc/bash_completion.d/brew ]; then
|
||||||
|
. "$BREW_PREFIX"/etc/bash_completion.d/brew
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f `brew --prefix`/Library/Contributions/brew_bash_completion.sh ]; then
|
if [ -f "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]; then
|
||||||
. `brew --prefix`/Library/Contributions/brew_bash_completion.sh
|
. "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue