diff --git a/libretroshare/src/version_detail.sh b/libretroshare/src/version_detail.sh index 61b5eaebb..03da58d67 100755 --- a/libretroshare/src/version_detail.sh +++ b/libretroshare/src/version_detail.sh @@ -3,6 +3,20 @@ #don't exit even if a command fails set +e + +if ( git log -n 1 &> /dev/null); then + #retrieve git information + version="git : $(git status | grep branch | cut -c 13-) $(git log -n 1 | grep commit | cut -c 8-)" +fi + +if ( git log -n 1 | grep svn &> /dev/null); then + #retrieve git svn information + version="$version svn : $(git log -n 1 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')" +elif ( git log -n 10 | grep svn &> /dev/null); then + #retrieve git svn information + version="$version svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')" +fi + if ( svn info &> /dev/null); then version=$(svn info | head -n 5 | tail -1) fi