shims/mac/super/scm/git: repair style
This commit is contained in:
parent
0c3256ba4c
commit
b910cf84b1
@ -3,7 +3,8 @@
|
|||||||
# This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and
|
# This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and
|
||||||
# no Xcode/CLT configurations. Order is careful to be what the user would want.
|
# no Xcode/CLT configurations. Order is careful to be what the user would want.
|
||||||
|
|
||||||
if [ -z "$HOMEBREW_LIBRARY" ]
|
# shellcheck disable=SC2154
|
||||||
|
if [ -z "${HOMEBREW_LIBRARY}" ]
|
||||||
then
|
then
|
||||||
echo "${0##*/}: This shim is internal and must be run via brew." >&2
|
echo "${0##*/}: This shim is internal and must be run via brew." >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -11,27 +12,28 @@ fi
|
|||||||
|
|
||||||
# Don't need shellcheck to follow the `source`.
|
# Don't need shellcheck to follow the `source`.
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh"
|
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
|
||||||
|
|
||||||
case "$(lowercase "$SHIM_FILE")" in
|
# shellcheck disable=SC2249
|
||||||
|
case "$(lowercase "${SHIM_FILE}")" in
|
||||||
git)
|
git)
|
||||||
if [[ -n "$HOMEBREW_GIT" && "$HOMEBREW_GIT" != git ]]
|
if [[ -n "${HOMEBREW_GIT}" && "${HOMEBREW_GIT}" != git ]]
|
||||||
then
|
then
|
||||||
safe_exec "$(type -P "$HOMEBREW_GIT")" "$@"
|
safe_exec "$(type -P "${HOMEBREW_GIT}")" "$@"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
svn)
|
svn)
|
||||||
if [[ -n "$HOMEBREW_SVN" && "$HOMEBREW_SVN" != svn ]]
|
if [[ -n "${HOMEBREW_SVN}" && "${HOMEBREW_SVN}" != svn ]]
|
||||||
then
|
then
|
||||||
safe_exec "$(type -P "$HOMEBREW_SVN")" "$@"
|
safe_exec "$(type -P "${HOMEBREW_SVN}")" "$@"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
brew_prefix_version="$HOMEBREW_PREFIX/bin/$SHIM_FILE"
|
brew_prefix_version="${HOMEBREW_PREFIX}/bin/${SHIM_FILE}"
|
||||||
safe_exec "$brew_prefix_version" "$@"
|
safe_exec "${brew_prefix_version}" "$@"
|
||||||
|
|
||||||
try_exec_non_system "$SHIM_FILE" "$@"
|
try_exec_non_system "${SHIM_FILE}" "$@"
|
||||||
|
|
||||||
if executable "/usr/bin/xcode-select"
|
if executable "/usr/bin/xcode-select"
|
||||||
then
|
then
|
||||||
@ -39,28 +41,28 @@ then
|
|||||||
# /usr/bin/<tool> will be a popup stub under such configuration.
|
# /usr/bin/<tool> will be a popup stub under such configuration.
|
||||||
# xcrun hangs if xcode-select is set to "/"
|
# xcrun hangs if xcode-select is set to "/"
|
||||||
xcode_path="$(/usr/bin/xcode-select -print-path 2>/dev/null)"
|
xcode_path="$(/usr/bin/xcode-select -print-path 2>/dev/null)"
|
||||||
if [[ -z "$xcode_path" ]]
|
if [[ -z "${xcode_path}" ]]
|
||||||
then
|
then
|
||||||
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -ge "100900" ]]
|
if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -ge "100900" ]]
|
||||||
then
|
then
|
||||||
popup_stub=1
|
popup_stub=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -z "$popup_stub" && "$xcode_path" != "/" ]]
|
if [[ -z "${popup_stub}" && "${xcode_path}" != "/" ]]
|
||||||
then
|
then
|
||||||
path="$(/usr/bin/xcrun -find "$SHIM_FILE" 2>/dev/null)"
|
path="$(/usr/bin/xcrun -find "${SHIM_FILE}" 2>/dev/null)"
|
||||||
safe_exec "$path" "$@"
|
safe_exec "${path}" "$@"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SHIM_FILE"
|
path="/Applications/Xcode.app/Contents/Developer/usr/bin/${SHIM_FILE}"
|
||||||
safe_exec "$path" "$@"
|
safe_exec "${path}" "$@"
|
||||||
|
|
||||||
if [[ -z "$popup_stub" && "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101500" ]]
|
if [[ -z "${popup_stub}" && "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "101500" ]]
|
||||||
then
|
then
|
||||||
path="/usr/bin/$SHIM_FILE"
|
path="/usr/bin/${SHIM_FILE}"
|
||||||
safe_exec "$path" "$@"
|
safe_exec "${path}" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "You must: brew install $SHIM_FILE" >&2
|
echo "You must: brew install ${SHIM_FILE}" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user