I’m trying to make a exs
script that would execute a couple of mix phx.gen.live
, however at some point, mix
generator asks for a confirmation:
The fact two entities are related in the database does not mean they belong to the same context.
If you are not sure, prefer creating a new context over adding to the existing one.
Would you like to proceed? [Yn] Y
And this is where it’s actually stuck and not proceeding to accept the input. I’m using my wrapper to execute commands via cmd /c
under Windows.
def cmd([_ | _] = what, options \\ []) do
{cmd, args, options} =
case :os.type() do
{:win32, _} ->
{"cmd", ["/c"] ++ what, options}
# _os_name
# ------------
# :darwin
# ...
{:unix, _os_name} ->
[head | tail] = what
{head, tail, options}
end
stream = IO.binstream(:stdio, :line)
options = Keyword.put_new(options, :into, stream)
System.cmd(cmd, args, options)
end
Is there anything else I might be missing?