shims/mac/super/xcrun: repair style
This commit is contained in:
parent
c0df2460ef
commit
7f33314e64
@ -5,21 +5,23 @@
|
||||
# it and attempts to avoid these issues.
|
||||
|
||||
# These could be used in conjunction with `--sdk` which ignores SDKROOT.
|
||||
if [[ "$*" =~ (^| )-?-show-sdk-(path|version|build) && -n "$HOMEBREW_DEVELOPER_DIR" ]]; then
|
||||
export DEVELOPER_DIR=$HOMEBREW_DEVELOPER_DIR
|
||||
# shellcheck disable=SC2154
|
||||
if [[ "$*" =~ (^| )-?-show-sdk-(path|version|build) && -n "${HOMEBREW_DEVELOPER_DIR}" ]]; then
|
||||
export DEVELOPER_DIR=${HOMEBREW_DEVELOPER_DIR}
|
||||
else
|
||||
# Some build tools set DEVELOPER_DIR, so discard it
|
||||
unset DEVELOPER_DIR
|
||||
fi
|
||||
|
||||
if [[ -z "$SDKROOT" && -n "$HOMEBREW_SDKROOT" ]]; then
|
||||
export SDKROOT=$HOMEBREW_SDKROOT
|
||||
if [[ -z "${SDKROOT}" && -n "${HOMEBREW_SDKROOT}" ]]; then
|
||||
export SDKROOT=${HOMEBREW_SDKROOT}
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
exec /usr/bin/xcrun "$@"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2249
|
||||
case "$1" in
|
||||
-*) exec /usr/bin/xcrun "$@" ;;
|
||||
esac
|
||||
@ -28,34 +30,34 @@ arg0=$1
|
||||
shift
|
||||
|
||||
exe="/usr/bin/${arg0}"
|
||||
if [[ -x "$exe" ]]; then
|
||||
if [[ -n "$HOMEBREW_PREFER_CLT_PROXIES" ]]; then
|
||||
exec "$exe" "$@"
|
||||
elif [[ -z "$HOMEBREW_SDKROOT" || ! -d "$HOMEBREW_SDKROOT" ]]; then
|
||||
exec "$exe" "$@"
|
||||
if [[ -x "${exe}" ]]; then
|
||||
if [[ -n "${HOMEBREW_PREFER_CLT_PROXIES}" ]]; then
|
||||
exec "${exe}" "$@"
|
||||
elif [[ -z "${HOMEBREW_SDKROOT}" || ! -d "${HOMEBREW_SDKROOT}" ]]; then
|
||||
exec "${exe}" "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
SUPERBIN=$(cd "${0%/*}" && pwd -P)
|
||||
|
||||
exe=$(/usr/bin/xcrun --find "$arg0" 2>/dev/null)
|
||||
if [[ -x "$exe" && "${exe%/*}" != "$SUPERBIN" ]]; then
|
||||
exec "$exe" "$@"
|
||||
exe=$(/usr/bin/xcrun --find "${arg0}" 2>/dev/null)
|
||||
if [[ -x "${exe}" && "${exe%/*}" != "${SUPERBIN}" ]]; then
|
||||
exec "${exe}" "$@"
|
||||
fi
|
||||
|
||||
old_IFS=$IFS
|
||||
old_IFS=${IFS}
|
||||
IFS=:
|
||||
for path in $PATH; do
|
||||
if [ "$path" = "$SUPERBIN" ]; then
|
||||
for path in ${PATH}; do
|
||||
if [ "${path}" = "${SUPERBIN}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
exe="${path}/${arg0}"
|
||||
if [ -x "$exe" ]; then
|
||||
exec "$exe" "$@"
|
||||
if [ -x "${exe}" ]; then
|
||||
exec "${exe}" "$@"
|
||||
fi
|
||||
done
|
||||
IFS=$old_IFS
|
||||
IFS=${old_IFS}
|
||||
|
||||
echo >&2 "
|
||||
Failed to execute ${arg0} ${*}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user