mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 11:09:55 +00:00
Update nodetool in upgrade_project
This commit is contained in:
parent
f04a1c9750
commit
1ee21c523f
1 changed files with 22 additions and 0 deletions
22
test/upgrade_project/rel/files/nodetool
Executable file → Normal file
22
test/upgrade_project/rel/files/nodetool
Executable file → Normal file
|
@ -7,6 +7,7 @@
|
|||
%% -------------------------------------------------------------------
|
||||
|
||||
main(Args) ->
|
||||
ok = start_epmd(),
|
||||
%% Extract the args
|
||||
{RestArgs, TargetNode} = process_args(Args, [], undefined),
|
||||
|
||||
|
@ -73,6 +74,27 @@ process_args([Arg | Rest], Acc, Opts) ->
|
|||
process_args(Rest, [Arg | Acc], Opts).
|
||||
|
||||
|
||||
start_epmd() ->
|
||||
[] = os:cmd(epmd_path() ++ " -daemon"),
|
||||
ok.
|
||||
|
||||
epmd_path() ->
|
||||
ErtsBinDir = filename:dirname(escript:script_name()),
|
||||
Name = "epmd",
|
||||
case os:find_executable(Name, ErtsBinDir) of
|
||||
false ->
|
||||
case os:find_executable(Name) of
|
||||
false ->
|
||||
io:format("Could not find epmd.~n"),
|
||||
halt(1);
|
||||
GlobalEpmd ->
|
||||
GlobalEpmd
|
||||
end;
|
||||
Epmd ->
|
||||
Epmd
|
||||
end.
|
||||
|
||||
|
||||
nodename(Name) ->
|
||||
case string:tokens(Name, "@") of
|
||||
[_Node, _Host] ->
|
||||
|
|
Loading…
Reference in a new issue