fix(nodetool): find release in releases
This commit is contained in:
parent
c929306cb9
commit
a1162249b5
20
bin/nodetool
20
bin/nodetool
|
@ -292,25 +292,11 @@ join([H|T], Sep) ->
|
||||||
|
|
||||||
add_libs_dir() ->
|
add_libs_dir() ->
|
||||||
[_ | _] = RootDir = os:getenv("RUNNER_ROOT_DIR"),
|
[_ | _] = RootDir = os:getenv("RUNNER_ROOT_DIR"),
|
||||||
RelFile = filename:join([RootDir, "releases",
|
CurrentVsn = os:getenv("REL_VSN"),
|
||||||
os:getenv("REL_VSN"),
|
|
||||||
"emqx.rel"
|
|
||||||
]),
|
|
||||||
case file:consult(RelFile) of
|
|
||||||
{ok, [{release, {_, _RelVsn}, {erts, _ErtsVsn}, Libs}]} ->
|
|
||||||
lists:foreach(
|
|
||||||
fun({Name, Vsn}) -> add_lib_dir(RootDir, Name, Vsn);
|
|
||||||
({Name, Vsn, _}) -> add_lib_dir(RootDir, Name, Vsn)
|
|
||||||
end, Libs);
|
|
||||||
{error, enoent} ->
|
|
||||||
%% rel file is deleted by release handler
|
|
||||||
add_libs_dir2(RootDir)
|
|
||||||
end.
|
|
||||||
|
|
||||||
add_libs_dir2(RootDir) ->
|
|
||||||
RelFile = filename:join([RootDir, "releases", "RELEASES"]),
|
RelFile = filename:join([RootDir, "releases", "RELEASES"]),
|
||||||
case file:consult(RelFile) of
|
case file:consult(RelFile) of
|
||||||
{ok, [[Release]]} ->
|
{ok, [Releases]} ->
|
||||||
|
Release = lists:keyfind(CurrentVsn, 3, Releases),
|
||||||
{release, _Name, _AppVsn, _ErtsVsn, Libs, _State} = Release,
|
{release, _Name, _AppVsn, _ErtsVsn, Libs, _State} = Release,
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({Name, Vsn, _}) ->
|
fun({Name, Vsn, _}) ->
|
||||||
|
|
Loading…
Reference in New Issue