Skip to content
Snippets Groups Projects
Unverified Commit cfa03c8c authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #8663 from maxim-belkin/use-homebrew-git-variable

brew.sh: use HOMEBREW_GIT to detect HOMEBREW_VERSION
parents 84f8068c b1cc9bde
No related branches found
No related tags found
No related merge requests found
......@@ -106,14 +106,6 @@ numeric() {
printf "%01d%02d%02d%03d" ${1//[.rc]/ } 2>/dev/null
}
HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbrev=7 2>/dev/null)"
HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION"
if [[ -z "$HOMEBREW_VERSION" ]]
then
HOMEBREW_VERSION=">=2.2.0 (shallow or no git repository)"
HOMEBREW_USER_AGENT_VERSION="2.X.Y"
fi
if [[ "$HOMEBREW_PREFIX" = "/" || "$HOMEBREW_PREFIX" = "/usr" ]]
then
# it may work, but I only see pain this route and don't want to support it
......@@ -144,6 +136,14 @@ else
HOMEBREW_GIT="git"
fi
HOMEBREW_VERSION="$("$HOMEBREW_GIT" -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbrev=7 2>/dev/null)"
HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION"
if [[ -z "$HOMEBREW_VERSION" ]]
then
HOMEBREW_VERSION=">=2.5.0 (shallow or no git repository)"
HOMEBREW_USER_AGENT_VERSION="2.X.Y"
fi
if [[ -n "$HOMEBREW_MACOS" ]]
then
HOMEBREW_PRODUCT="Homebrew"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment