Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/anubis/transport/stdio.ex
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,14 @@ defmodule Anubis.Transport.STDIO do

env = normalize_env_for_erlang(env)

# As per erlang docs, :hide only affects Windows and gets ignored anywhere else.
# https://www.erlang.org/doc/apps/erts/erlang#open_port/2
opts =
[:binary]
[:hide, :binary]
|> then(&if is_nil(state.args), do: &1, else: Enum.concat(&1, args: state.args))
|> then(&if is_nil(state.env), do: &1, else: Enum.concat(&1, env: env))
|> then(&if is_nil(state.cwd), do: &1, else: Enum.concat(&1, cd: state.cwd))
|> then(&if :os.type() == {:win32, :nt}, do: [{:hide, true} | &1], else: &1)
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Port.open({:spawn_executable, cmd}, opts)
end
Expand Down