Method: Pkg::Util::Git.describe

Defined in:
lib/packaging/util/git.rb

.describe(extra_opts = ['--tags', '--dirty']) ⇒ Object

Returns the value of ‘git describe`. If this is not a git repo or `git describe` fails because there is no tag, this will return false



67
68
69
70
71
72
73
74
75
76
# File 'lib/packaging/util/git.rb', line 67

def describe(extra_opts = ['--tags', '--dirty'])
  Pkg::Util.in_project_root do
    stdout, _, ret = Pkg::Util::Execution.capture3("#{Pkg::Util::Tool::GIT} describe #{Array(extra_opts).join(' ')}")
    if Pkg::Util::Execution.success?(ret)
      stdout.strip
    else
      false
    end
  end
end