Code Monkey home page Code Monkey logo

Comments (7)

josevalim avatar josevalim commented on May 16, 2024 5

Unfortunately I don't think System.argv will work today... unless you set it explicitly or we do improvements to releases. :)

from bakeware.

Faheetah avatar Faheetah commented on May 16, 2024 5

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

from bakeware.

stefanchrobot avatar stefanchrobot commented on May 16, 2024 2

I love you, guys! ❤️

from bakeware.

fhunleth avatar fhunleth commented on May 16, 2024 1

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!

from bakeware.

tsloughter avatar tsloughter commented on May 16, 2024

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.

from bakeware.

josevalim avatar josevalim commented on May 16, 2024

@tsloughter so, our current release doesn't do that :)

from bakeware.

tsloughter avatar tsloughter commented on May 16, 2024

Aah ok. I assumed it was the same as our (rebar3/relx) scripts that does -- $@ or whatever.

from bakeware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.