diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 0a4ed984441a51603dedb3e5f06852e00e0bc401..aaaa9345891808839401bf41dfb2ea38ad98248d 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -26,8 +26,17 @@ esac # Higher depths mean this command was invoked by another Homebrew command. export HOMEBREW_COMMAND_DEPTH=$((HOMEBREW_COMMAND_DEPTH + 1)) +ohai() { + if [[ -t 1 && -z "$HOMEBREW_NO_COLOR" ]] # check whether stdout is a tty. + then + echo -e "\\033[34m==>\\033[0m \\033[1m$*\\033[0m" # blue arrow and bold text + else + echo "==> $*" + fi +} + onoe() { - if [[ -t 2 ]] # check whether stderr is a tty. + if [[ -t 2 && -z "$HOMEBREW_NO_COLOR" ]] # check whether stderr is a tty. then echo -ne "\\033[4;31mError\\033[0m: " >&2 # highlight Error with underline and red color else diff --git a/Library/Homebrew/cmd/update-reset.sh b/Library/Homebrew/cmd/update-reset.sh index d8454773f9c3c2686d29e62bc0972859da3ff536..2b8de794a87058335a1fdd5e54ae27baa7eca75b 100644 --- a/Library/Homebrew/cmd/update-reset.sh +++ b/Library/Homebrew/cmd/update-reset.sh @@ -36,11 +36,11 @@ homebrew-update-reset() { do [[ -d "$DIR/.git" ]] || continue cd "$DIR" || continue - echo "==> Fetching $DIR..." + ohai "Fetching $DIR..." git fetch --force --tags origin echo - echo "==> Resetting $DIR..." + ohai "Resetting $DIR..." git checkout --force -B master origin/master echo done diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 3d6439e5918e81abf4fd852096b2fce1c17da44d..fdd49136208f77e25a39b0393d0b2226802dee67 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -87,7 +87,7 @@ fetch() { temporary_path="$CACHED_LOCATION.incomplete" mkdir -p "$HOMEBREW_CACHE" - [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Downloading $VENDOR_URL" >&2 + [[ -n "$HOMEBREW_QUIET" ]] || ohai "Downloading $VENDOR_URL" >&2 if [[ -f "$CACHED_LOCATION" ]] then [[ -n "$HOMEBREW_QUIET" ]] || echo "Already downloaded: $CACHED_LOCATION" >&2 @@ -107,7 +107,7 @@ fetch() { if [[ ! -f "$temporary_path" ]] then - [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Downloading $VENDOR_URL2" >&2 + [[ -n "$HOMEBREW_QUIET" ]] || ohai "Downloading $VENDOR_URL2" >&2 "$HOMEBREW_CURL" "${curl_args[@]}" "$VENDOR_URL2" -o "$temporary_path" fi @@ -180,7 +180,7 @@ install() { fi safe_cd "$VENDOR_DIR" - [[ -n "$HOMEBREW_QUIET" ]] || echo "==> Pouring $(basename "$VENDOR_URL")" >&2 + [[ -n "$HOMEBREW_QUIET" ]] || ohai "Pouring $(basename "$VENDOR_URL")" >&2 tar "$tar_args" "$CACHED_LOCATION" safe_cd "$VENDOR_DIR/portable-$VENDOR_NAME"