aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2017-07-25 16:12:25 +0100
committerGitHub2017-07-25 16:12:25 +0100
commit53038a14b37158bc32c7c54b16cb4e06333dd8c4 (patch)
treeedf6deff63d92527ffdd9de3fdb39d2d1d45e230 /Library/Homebrew
parent733abc7e7d46e086af9bda4702ff27c3b9faf81c (diff)
parentbe1764c0a576357168480899dbcb5225474a25db (diff)
downloadbrew-53038a14b37158bc32c7c54b16cb4e06333dd8c4.tar.bz2
Merge pull request #2940 from kevinburke/move-brew-prefix
Speed up brew --prefix
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/brew.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 35e3eaa02..c40ce8bf7 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -1,3 +1,24 @@
+# Force UTF-8 to avoid encoding issues for users with broken locale settings.
+if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
+then
+ export LC_ALL="en_US.UTF-8"
+fi
+
+# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
+# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
+if [[ -d "$HOMEBREW_REPOSITORY/Cellar" ]]
+then
+ HOMEBREW_CELLAR="$HOMEBREW_REPOSITORY/Cellar"
+else
+ HOMEBREW_CELLAR="$HOMEBREW_PREFIX/Cellar"
+fi
+
+case "$*" in
+ --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;;
+ --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;;
+ --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;;
+esac
+
HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbrev=7 2>/dev/null)"
HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION"
if [[ -z "$HOMEBREW_VERSION" ]]
@@ -42,27 +63,6 @@ git() {
"$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" "$@"
}
-# Force UTF-8 to avoid encoding issues for users with broken locale settings.
-if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
-then
- export LC_ALL="en_US.UTF-8"
-fi
-
-# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
-# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
-if [[ -d "$HOMEBREW_REPOSITORY/Cellar" ]]
-then
- HOMEBREW_CELLAR="$HOMEBREW_REPOSITORY/Cellar"
-else
- HOMEBREW_CELLAR="$HOMEBREW_PREFIX/Cellar"
-fi
-
-case "$*" in
- --prefix) echo "$HOMEBREW_PREFIX"; exit 0 ;;
- --cellar) echo "$HOMEBREW_CELLAR"; exit 0 ;;
- --repository|--repo) echo "$HOMEBREW_REPOSITORY"; exit 0 ;;
-esac
-
if [[ "$HOMEBREW_PREFIX" = "/" || "$HOMEBREW_PREFIX" = "/usr" ]]
then
# it may work, but I only see pain this route and don't want to support it