bin/brew: fix incorrect argument manipulation
Shifting `-v` argument is all we need to do. We shouldn't enumerate arguments.
This commit is contained in:
parent
92a71a534f
commit
6b5b8757bf
21
bin/brew
21
bin/brew
@ -118,18 +118,15 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in "$@"
|
if [[ "$1" = -v ]]
|
||||||
do
|
then
|
||||||
if [[ "$1" = -v ]]
|
# Shift the -v to the end of the parameter list
|
||||||
then
|
shift
|
||||||
shift
|
set -- "$@" -v
|
||||||
set -- "$@" -v
|
fi
|
||||||
fi
|
|
||||||
[[ "$i" =~ ^- ]] && continue
|
HOMEBREW_COMMAND="$1"
|
||||||
HOMEBREW_COMMAND="$i"
|
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$1.sh"
|
||||||
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$i.sh"
|
|
||||||
break
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$(id -u)" = "0" ] && [ "$(stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]
|
if [ "$(id -u)" = "0" ] && [ "$(stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]
|
||||||
then
|
then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user