diff options
author | Ralph Amissah <ralph@amissah.com> | 2015-04-12 15:56:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2015-04-13 16:39:36 -0400 |
commit | d0ad76e346541c7ed532c49f31d2f671c81eb175 (patch) | |
tree | 052b362830e61302344cc87ea037c4aac8f5c3e6 /bin | |
parent | documentation, acquiring source & installation, minor (diff) |
bin/sisu when run from dir tree, check git describe version info
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sisu | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -163,6 +163,25 @@ class Orient else nil end end + def git_version + if sisu_run_from? == :full_path_to_sisu_bin_in_sisu_dir_tree \ + && FileTest.file?('/usr/bin/git') \ + && FileTest.directory?(processing.sisu_runtime_path.gsub(/\/bin\/sisu\S*/,'/.git')) + bin_base=processing.sisu_runtime_path.gsub(/\/bin\/sisu\S*/,'') + pwd=Dir.pwd + Dir.chdir(bin_base) + x=`git describe --long --tags 2>&1`.strip. + gsub(/^[a-z_-]*([0-9.]+)/,'\1'). + gsub(/([^-]*-g)/,'r\1'). + gsub(/-/,'.') + x=(x=~/^[0-9]+\.[0-9]+\.[0-9]+\.r[0-9]+\.g[0-9a-f]{7}/) \ + ? x + : nil + Dir.chdir(pwd) + x + else nil + end + end def sisu_path_base case paths_set when :set_path_system @@ -238,6 +257,9 @@ class Orient def language_list_regex? language_list.regex end + def git_version_info? + git_version + end def runtime? { call_path: called_from?, |