Sha256: f502c2f1b5717d41d0fb645e15548a82710730cf3abbaaa4232594a8837e649c
Contents?: true
Size: 454 Bytes
Versions: 66
Compression:
Stored size: 454 Bytes
Contents
module Jets::Cfn::Builders::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
66 entries across 66 versions & 2 rubygems