summaryrefslogtreecommitdiff
path: root/src/rebar_app_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_app_utils.erl')
-rw-r--r--src/rebar_app_utils.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl
index 1fa870b..34d357a 100644
--- a/src/rebar_app_utils.erl
+++ b/src/rebar_app_utils.erl
@@ -89,7 +89,14 @@ app_applications(AppFile) ->
app_vsn(AppFile) ->
case load_app_file(AppFile) of
{ok, _, AppInfo} ->
- get_value(vsn, AppInfo, AppFile);
+ case get_value(vsn, AppInfo, AppFile) of
+ git ->
+ Cmd = "git describe --tags --always",
+ {ok, VsnString} = rebar_utils:sh(Cmd, []),
+ string:strip(VsnString, right, $\n);
+ Version ->
+ Version
+ end;
{error, Reason} ->
?ABORT("Failed to extract vsn from ~s: ~p\n",
[AppFile, Reason])