diff options
author | Eric <[email protected]> | 2013-10-28 14:11:51 -0700 |
---|---|---|
committer | Eric <[email protected]> | 2013-10-28 14:11:51 -0700 |
commit | 7a1083d2a881b511e202edd0e2ff2b207e23ae5b (patch) | |
tree | 007b507875004456935bc006acfa781b0eae87a2 /src/rlx_app_info.erl | |
parent | 0f5ffc5df74ff5c308ee3d1dc657e20edc4f1cb8 (diff) | |
download | relx-7a1083d2a881b511e202edd0e2ff2b207e23ae5b.tar.gz relx-7a1083d2a881b511e202edd0e2ff2b207e23ae5b.tar.bz2 relx-7a1083d2a881b511e202edd0e2ff2b207e23ae5b.zip |
support using the original app vsn as a string not the parsed vsn
Diffstat (limited to 'src/rlx_app_info.erl')
-rw-r--r-- | src/rlx_app_info.erl | 10 |
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))). |