This commit is contained in:
anlicheng 2025-05-05 23:27:17 +08:00
parent 7214a9d160
commit dab42088f2

View File

@ -49,9 +49,12 @@ startup(#manifest{work_dir = WorkDir, exec = ExecCmd0, args = Args0}) ->
],
ExecCmd = binary_to_list(ExecCmd0),
RealExecCmd = filename:absname_join(WorkDir, ExecCmd),
Port = erlang:open_port({spawn_executable, RealExecCmd}, PortSettings),
{ok, Port}.
case catch erlang:open_port({spawn_executable, RealExecCmd}, PortSettings) of
Port when is_port(Port) ->
{ok, Port};
_Other ->
{error, <<"exec command startup failed">>}
end.
%%
-spec check_manifest(Manifest :: map()) -> {ok, #manifest{}} | {error, Reason :: binary()}.