Reputation: 1481
I'm trying to rum many mix phx.gen.html commands from a script but only first command is executed. I tried different ways, some of them are below, but nothing worked:
Mix.Task.run "phx.gen.html", Parser.parse "Contacts Skype skypes user_id:references:users skype --parent user"
Mix.Task.run "phx.gen.html", Parser.parse "Contacts Phone phones user_id:references:users number --parent user"
Mix.Task.run "phx.gen.html", Parser.parse "Contacts Address addresses user_id:references:users country state region city zip street house corp flat --parent user"
===========
commands = [
"Contacts Skype skypes user_id:references:users skype --parent user",
"Contacts Phone phones user_id:references:users number --parent user",
"Contacts Address addresses user_id:references:users country state region city zip street house corp flat --parent user"]
for command <- commands do
list = String.split(command, " ")
list = ["phx.gen.html" | list]
System.cmd("mix", list)
end
for command <- commands do
list = String.split(command, " ")
IO.inspect list
Mix.Task.run "phx.gen.html", list
end
Upvotes: 0
Views: 83