Code Monkey home page Code Monkey logo

Comments (8)

ysbaddaden avatar ysbaddaden commented on May 18, 2024

It sounds legit to drop .env now that we have .praxrc. I still like .env better, because it's more generic across tools, but different tools allow different parsing... sigh. Maybe we could interpolate variables as they are read from .env, looking in just parsed variables, then falling back to ENV?

from prax.cr.

jacksonrayhamilton avatar jacksonrayhamilton commented on May 18, 2024

Regarding interpolation: You could support it if you want. It wouldn't matter much to me, as long as Prax at least supported simple interpolation like VAR=$OTHER_VAR.

Although, for full compatibility with dotenv, Prax would also want to support other shell-isms, including optional export, optional single or double quotes, optional {} (like ${VARIABLE}), and escaping the $ with \ (like STATEMENT=SHOW ME THE \$\$\$). (See dotenv/parser.rb and dotenv/variable.rb.)

Personally, I wouldn't do it, as it seems to beckon maintaining a miniature embedded shell language.

from prax.cr.

ysbaddaden avatar ysbaddaden commented on May 18, 2024

Sigh, .env should be a simple A=B mecanism for providing the app with some per-install values, and then let the app interpolate the values, if necessary, from those bits...

from prax.cr.

jacksonrayhamilton avatar jacksonrayhamilton commented on May 18, 2024

Yep, this situation stinks. Another solution might be to keep the current ".env" parsing behavior, but allow the name of the file to be configured, so it could still be utilized, but not conflict with dotenv.

from prax.cr.

jacksonrayhamilton avatar jacksonrayhamilton commented on May 18, 2024

Another idea for implementing this: We rip the bandage off. We can immediately drop support for ".env", but if a ".env" file is detected in a project, Prax will print "Setting environment variables via '.env' has been removed. Please use a '.praxrc' shell script in the project to set environment variables instead. Disable this message by setting PRAX_ACKNOWLEDGE_ENV_REMOVAL=true."

I figure this may be better than deprecation and eventual removal, since we can immediately save dotenv users from the same fate that I had, also the removal is going to inconvenience people at some point no matter what (some people will wait to deal with deprecation until the bitter end).

from prax.cr.

jacksonrayhamilton avatar jacksonrayhamilton commented on May 18, 2024

Sweet, we finally fixed it! 🤝 Can we make a release?

from prax.cr.

ysbaddaden avatar ysbaddaden commented on May 18, 2024

Yes: v0.7.0

from prax.cr.

jacksonrayhamilton avatar jacksonrayhamilton commented on May 18, 2024

Installed the .deb yesterday and it worked just dandy.

from prax.cr.

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.