mirror of
https://gitee.com/dgiiot/dgiot.git
synced 2024-12-02 04:08:54 +08:00
26 lines
709 B
Erlang
26 lines
709 B
Erlang
%%-*- mode: erlang -*-
|
|
%% .app.src.script
|
|
|
|
RemoveLeadingV =
|
|
fun(Tag) ->
|
|
case re:run(Tag, "v\[0-9\]+\.\[0-9\]+\.*") of
|
|
nomatch ->
|
|
Tag;
|
|
{match, _} ->
|
|
%% if it is a version number prefixed by 'v' then remove the 'v'
|
|
"v" ++ Vsn = Tag,
|
|
Vsn
|
|
end
|
|
end,
|
|
|
|
case os:getenv("EMQX_DEPS_DEFAULT_VSN") of
|
|
false -> CONFIG; % env var not defined
|
|
[] -> CONFIG; % env var set to empty string
|
|
Tag ->
|
|
[begin
|
|
AppConf0 = lists:keystore(vsn, 1, AppConf, {vsn, RemoveLeadingV(Tag)}),
|
|
{application, App, AppConf0}
|
|
end || Conf = {application, App, AppConf} <- CONFIG]
|
|
end.
|
|
|