summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
authorIsmael Luceno2014-07-02 08:42:28 -0300
committerIsmael Luceno2014-07-02 14:08:58 -0300
commit1cb0116b167025e3758bcdac6a9b70166e7dfb50 (patch)
tree7df1a61a3221ec89fd6008c66c5afc151be4da4a /FUNCTIONS
parent95c6323e73a818fce3a4a025bf0b28868a7780d0 (diff)
FUNCTIONS: Add get_scm_version function
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS12
1 files changed, 12 insertions, 0 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index 970d6975f0..8671001a77 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -662,6 +662,18 @@ function get_up_spell_name() {
echo ${1:-$SPELL} | tr "a-z-" "A-Z_"
}
+#---
+## Get branch-based/autoupdate-aware version number
+#---
+function get_scm_version() {
+ local spell=$(get_up_spell_name) &&
+ local spell_branch="$spell"_BRANCH &&
+ local spell_autoupdate="$spell"_AUTOUPDATE &&
+ echo "${!spell_branch:-scm}$(
+ [[ "${!spell_autoupdate}" = y ]] && date "+-%Y%m%d")"
+}
+
+
# Move SPELL_OPTS to OPTS
# basicly generic OPTS="$SPELL_OPTS $OPTS"
function prepare_opts() {