From 2bb30fc5f0ab4146190e65d017ea0ad4eac40dbf Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sun, 6 Mar 2016 15:01:54 +0800 Subject: --version/config: show core tap information --- Library/Homebrew/utils.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Library/Homebrew/utils.rb') diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 98ebcc9c8..0675cce5d 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -229,6 +229,18 @@ module Homebrew end end + def self.core_tap_version_string + require "tap" + tap = CoreTap.instance + return "N/A" unless tap.installed? + if pretty_revision = tap.git_short_head + last_commit = tap.git_last_commit_date + "(git revision #{pretty_revision}; last commit #{last_commit})" + else + "(no git repository)" + end + end + def self.install_gem_setup_path!(gem, version = nil, executable = gem) require "rubygems" -- cgit v1.2.3