aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_app_info.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rlx_app_info.erl')
-rw-r--r--src/rlx_app_info.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rlx_app_info.erl b/src/rlx_app_info.erl
index a738cb8..931c139 100644
--- a/src/rlx_app_info.erl
+++ b/src/rlx_app_info.erl
@@ -40,6 +40,7 @@
new/5,
name/1,
name/2,
+ original_vsn/1,
vsn/1,
vsn/2,
vsn_as_string/1,
@@ -60,6 +61,7 @@
-include("relx.hrl").
-record(app_info_t, {name :: atom(),
+ original_vsn :: string(),
vsn :: ec_semver:semver(),
dir :: file:name(),
link=false :: boolean(),
@@ -97,7 +99,9 @@ new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps, Link)
{fail, _} ->
?RLX_ERROR({vsn_parse, AppName});
ParsedVsn ->
- {ok, #app_info_t{name=AppName, vsn=ParsedVsn, dir=Dir,
+ {ok, #app_info_t{name=AppName, original_vsn=Vsn,
+ vsn=ParsedVsn,
+ dir=Dir,
active_deps=ActiveDeps,
library_deps=LibraryDeps,
link=Link}}
@@ -116,6 +120,10 @@ name(AppInfo=#app_info_t{}, AppName)
vsn(#app_info_t{vsn=Vsn}) ->
Vsn.
+-spec original_vsn(t()) -> string().
+original_vsn(#app_info_t{original_vsn=Vsn}) ->
+ Vsn.
+
-spec vsn_as_string(t()) -> string().
vsn_as_string(#app_info_t{vsn=Vsn}) ->
erlang:binary_to_list(erlang:iolist_to_binary(ec_semver:format(Vsn))).