Sha256: 4c12fef88b023ac4b0aec0d4bfab5f9df1a0bd6fe8f8bdaa57ac9883eccd75e4
Contents?: true
Size: 453 Bytes
Versions: 15
Compression:
Stored size: 453 Bytes
Contents
module Jets::Cfn::Builder::Util class Source class << self 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 private def git_installed? system("type git > /dev/null 2>&1") end def sh(command) `#{command}`.strip end end end end
Version data entries
15 entries across 15 versions & 1 rubygems