iface #16

Merged
zxq9 merged 7 commits from iface into master 2025-11-20 16:02:09 +09:00
Showing only changes of commit 30dda02cc4 - Show all commits

View File

@ -378,12 +378,16 @@ do_gajudesk() ->
GajuDesk = "zx run gajudesk", GajuDesk = "zx run gajudesk",
Command = Command =
case os:type() of case os:type() of
{unix, _} -> detach_unix(GajuDesk); {unix, darwin} -> detach_darwin(GajuDesk);
{win32, nt} -> detach_windows(GajuDesk) {unix, _} -> detach_unix(GajuDesk);
{win32, nt} -> detach_windows(GajuDesk)
end, end,
Out = os:cmd(Command), Out = os:cmd(Command),
log(info, "os:cmd(~s) -> ~s", [Command, Out]). log(info, "os:cmd(~s) -> ~s", [Command, Out]).
detach_darwin(Command) ->
"nohup " ++ Command ++ " >/dev/null 2>&1 & disown".
detach_unix(Command) -> detach_unix(Command) ->
"setsid sh -c 'exec nohup " ++ Command ++ " >/dev/null 2>&1' &". "setsid sh -c 'exec nohup " ++ Command ++ " >/dev/null 2>&1' &".