mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
style: fix inconsistent code style for shell scripts by runing brew style --fix
This commit is contained in:
parent
bd8db0737d
commit
43377a3e5e
@ -56,15 +56,42 @@ HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}"
|
||||
# HOMEBREW_LIBRARY set by bin/brew
|
||||
# shellcheck disable=SC2249,SC2154
|
||||
case "$*" in
|
||||
--cellar) echo "${HOMEBREW_CELLAR}"; exit 0 ;;
|
||||
--repository | --repo) echo "${HOMEBREW_REPOSITORY}"; exit 0 ;;
|
||||
--caskroom) echo "${HOMEBREW_PREFIX}/Caskroom"; exit 0 ;;
|
||||
--cache) echo "${HOMEBREW_CACHE}"; exit 0 ;;
|
||||
shellenv) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;;
|
||||
formulae) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;;
|
||||
casks) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/casks.sh"; homebrew-casks; exit 0 ;;
|
||||
--cellar)
|
||||
echo "${HOMEBREW_CELLAR}"
|
||||
exit 0
|
||||
;;
|
||||
--repository | --repo)
|
||||
echo "${HOMEBREW_REPOSITORY}"
|
||||
exit 0
|
||||
;;
|
||||
--caskroom)
|
||||
echo "${HOMEBREW_PREFIX}/Caskroom"
|
||||
exit 0
|
||||
;;
|
||||
--cache)
|
||||
echo "${HOMEBREW_CACHE}"
|
||||
exit 0
|
||||
;;
|
||||
shellenv)
|
||||
source "${HOMEBREW_LIBRARY}/Homebrew/cmd/shellenv.sh"
|
||||
homebrew-shellenv
|
||||
exit 0
|
||||
;;
|
||||
formulae)
|
||||
source "${HOMEBREW_LIBRARY}/Homebrew/cmd/formulae.sh"
|
||||
homebrew-formulae
|
||||
exit 0
|
||||
;;
|
||||
casks)
|
||||
source "${HOMEBREW_LIBRARY}/Homebrew/cmd/casks.sh"
|
||||
homebrew-casks
|
||||
exit 0
|
||||
;;
|
||||
# falls back to cmd/prefix.rb on a non-zero return
|
||||
--prefix*) source "${HOMEBREW_LIBRARY}/Homebrew/prefix.sh"; homebrew-prefix "$@" && exit 0 ;;
|
||||
--prefix*)
|
||||
source "${HOMEBREW_LIBRARY}/Homebrew/prefix.sh"
|
||||
homebrew-prefix "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
#####
|
||||
|
@ -11,7 +11,10 @@ homebrew-update-reset() {
|
||||
for option in "$@"
|
||||
do
|
||||
case "${option}" in
|
||||
-\? | -h | --help | --usage) brew help update-reset; exit $? ;;
|
||||
-\? | -h | --help | --usage)
|
||||
brew help update-reset
|
||||
exit $?
|
||||
;;
|
||||
--debug) HOMEBREW_DEBUG=1 ;;
|
||||
-*)
|
||||
[[ "${option}" == *d* ]] && HOMEBREW_DEBUG=1
|
||||
|
@ -312,7 +312,10 @@ homebrew-update() {
|
||||
for option in "$@"
|
||||
do
|
||||
case "${option}" in
|
||||
-\? | -h | --help | --usage) brew help update; exit $? ;;
|
||||
-\? | -h | --help | --usage)
|
||||
brew help update
|
||||
exit $?
|
||||
;;
|
||||
--verbose) HOMEBREW_VERBOSE=1 ;;
|
||||
--debug) HOMEBREW_DEBUG=1 ;;
|
||||
--quiet) HOMEBREW_QUIET=1 ;;
|
||||
|
@ -259,7 +259,10 @@ homebrew-vendor-install() {
|
||||
for option in "$@"
|
||||
do
|
||||
case "${option}" in
|
||||
-\?|-h|--help|--usage) brew help vendor-install; exit $? ;;
|
||||
-\? | -h | --help | --usage)
|
||||
brew help vendor-install
|
||||
exit $?
|
||||
;;
|
||||
--verbose) HOMEBREW_VERBOSE=1 ;;
|
||||
--quiet) HOMEBREW_QUIET=1 ;;
|
||||
--debug) HOMEBREW_DEBUG=1 ;;
|
||||
|
@ -10,13 +10,15 @@ homebrew-prefix() {
|
||||
case "$1" in
|
||||
# check we actually have --prefix and not e.g. --prefixsomething
|
||||
--prefix)
|
||||
local prefix="1"; shift
|
||||
local prefix="1"
|
||||
shift
|
||||
;;
|
||||
# reject all other flags
|
||||
-*) return 1 ;;
|
||||
*)
|
||||
[[ -n "${formula}" ]] && return 1
|
||||
local formula="$1"; shift
|
||||
local formula="$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user