Skip to content

Commit

Permalink
Merge pull request #20 from akash-akya/dev
Browse files Browse the repository at this point in the history
Fix executable path
  • Loading branch information
akash-akya authored Apr 29, 2023
2 parents 51adb42 + 6ed5259 commit c191bfc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/exile/process/exec.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ defmodule Exile.Process.Exec do
env: [{String.t(), String.t()}]
}

@spawner_path :filename.join(:code.priv_dir(:exile), "spawner")

@spec start(args, boolean()) :: %{
port: port,
stdin: non_neg_integer(),
Expand Down Expand Up @@ -39,7 +37,7 @@ defmodule Exile.Process.Exec do
[:nouse_stdio, :exit_status, :binary, args: spawner_cmdline_args] ++
prune_nils(env: env, cd: cd)

port = Port.open({:spawn_executable, @spawner_path}, port_opts)
port = Port.open({:spawn_executable, spawner_path()}, port_opts)

{:os_pid, os_pid} = Port.info(port, :os_pid)
Exile.Watcher.watch(self(), os_pid, socket_path)
Expand Down Expand Up @@ -67,6 +65,11 @@ defmodule Exile.Process.Exec do
end
end

@spec spawner_path :: String.t()
defp spawner_path do
:filename.join(:code.priv_dir(:exile), "spawner")
end

@socket_timeout 2000

@spec receive_fds(:socket.socket(), boolean) :: {Pipe.fd(), Pipe.fd(), Pipe.fd()}
Expand Down

0 comments on commit c191bfc

Please sign in to comment.