bakeware
bakeware copied to clipboard
Fantastic job!
This looks amazing!
Let me know if you believe there are improvements we can do to our release scripts. In particular, I wonder if it is worth supporting bin/my_app start ARGV
so you can access argv as System.argv
directly. :)
Yes! In our rush, we totally missed System.argv
, but we definitely want to switch to that. That will clean up one of the areas that I was unhappy with and wanted to revisit. Thanks!
Unfortunately I don't think System.argv will work today... unless you set it explicitly or we do improvements to releases. :)
I love you, guys! ❤️
Why wouldn't argv
work?
Does this not run the regular start script that simply appends the additional args to the erl command? I did similar to this project with makeself.io and argument passing works fine if I remember correctly.
@tsloughter so, our current release doesn't do that :)
Aah ok. I assumed it was the same as our (rebar3/relx) scripts that does -- $@
or whatever.
I was playing around with bakeware today and I am impressed how clean the end result feels. I've dealt with plenty of small systems utilities (like stuff written in Go) and they have the benefit of dropping a small (<10mb) blob on a box and running it. A bakeware bundle feels a lot like that. But those kinds of small applications typically lean heavily on arguments. If the whole argv issue could be sorted it out it would open up a lot more use cases for using Elixir, and would generally be more flexible for everyone. I hope this is something that can be worked out over time, but looking at how releases work I can see how it's not immediately feasible.
Edit: I was able to kind of replicate argv() behavior by iterating over the environment variables, I had a case of the RTFM here but this works
defp argv() do
nargs =
System.get_env("BAKEWARE_ARGC")
|> String.to_integer()
for n <- 1..nargs, do: System.get_env("BAKEWARE_ARG#{n}")
end