aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/sisu22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/sisu b/bin/sisu
index dc399737..9bb41736 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -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?,