Class: Jets::Cfn::Builders::Util::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/jets/cfn/builders/util/source.rb

Class Method Summary collapse

Class Method Details

.versionObject



4
5
6
7
8
9
# File 'lib/jets/cfn/builders/util/source.rb', line 4

def version
  return '' unless git_installed?
  sha = sh "git rev-parse HEAD 2>/dev/null"
  return '' if sha == ''  # if its not a git repo, it'll be an empty string
  sha[0..7]
end