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

Merge pull request #1076 from MikeMcQuaid/homebrew-version-git-describe

Use git describe to get the HOMEBREW_VERSION.
parents 9784fa41 f0e9292a
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ $:.unshift(HOMEBREW_LIBRARY_PATH.to_s)
require "global"
if ARGV == %w[--version] || ARGV == %w[-v]
puts "Homebrew #{Homebrew.homebrew_version_string}"
puts "Homebrew #{HOMEBREW_VERSION}"
puts "Homebrew/homebrew-core #{Homebrew.core_tap_version_string}"
exit 0
end
......
HOMEBREW_VERSION="1.0.0"
HOMEBREW_VERSION="$(git describe --tags --dirty 2>/dev/null)"
if [[ -z "$HOMEBREW_VERSION" ]]
then
HOMEBREW_VERSION=">1.0.0 (no git repository)"
fi
onoe() {
if [[ -t 2 ]] # check whether stderr is a tty.
......
......@@ -248,15 +248,6 @@ module Homebrew
_system(cmd, *args)
end
def self.homebrew_version_string
if pretty_revision = HOMEBREW_REPOSITORY.git_short_head
last_commit = HOMEBREW_REPOSITORY.git_last_commit_date
"#{HOMEBREW_VERSION} (git revision #{pretty_revision}; last commit #{last_commit})"
else
"#{HOMEBREW_VERSION} (no git repository)"
end
end
def self.core_tap_version_string
require "tap"
tap = CoreTap.instance
......
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