Maybe this works for killing on Windows
This commit is contained in:
parent
d1e341e37c
commit
8249d5c32b
1 changed files with 10 additions and 2 deletions
|
@ -38,7 +38,7 @@ defmodule MBU.AppRunner do
|
|||
end
|
||||
|
||||
def kill(pid) do
|
||||
System.find_executable("kill") |> System.cmd([pid])
|
||||
os_kill(pid, :os.type())
|
||||
end
|
||||
|
||||
def wait_loop(port) do
|
||||
|
@ -101,6 +101,14 @@ defmodule MBU.AppRunner do
|
|||
]
|
||||
)
|
||||
end
|
||||
|
||||
defp os_kill(pid, {:win32, _}) do
|
||||
System.find_executable("cmd") |> System.cmd(["/c", "taskkill", "/PID", pid, "/F"])
|
||||
end
|
||||
|
||||
defp os_kill(pid, _) do
|
||||
System.find_executable("kill") |> System.cmd([pid])
|
||||
end
|
||||
end
|
||||
|
||||
[program | args] = System.argv()
|
||||
|
|
Loading…
Reference in a new issue