Live data from Hacker News

Show HN: Dotenv, if it is a Unix utility

github.com

61–70 of 108 posts

Re: Show HN: Dotenv, if it is a Unix utility

#62

export $(cat .env | xargs) Agree with the premise but this can be achieved with actual Unix concepts no need for anything else. The language runtime dotenv projects are banned in my engineering org.

When your environment variable values have spaces (e.g. some connection strings) this doesn’t work iirc

Re: Show HN: Dotenv, if it is a Unix utility

#64
post #50

Earlier quoted context omitted.

What happens when, 30 commands later, you execute a command in your shell and didn't remember that message from a day or so ago?

It’s the same as forgetting you put something in your .profile or .bashrc, no? In any case, both forgetting the env config and using the same shell for days in a row seem like two things that probably don’t coincide too often.

I never close my shell, I never reboot my laptop unless necessary - an uptime of 6+ months is normal. So my experience may be different.

Re: Show HN: Dotenv, if it is a Unix utility

#65
post #2

I think direnv already does a good job in this space, and it's already available in your package manager. https://direnv.net/

…Just don’t commit your .envrc to a repository & add it to the .(git|hg)*ignore. Provide an example if you want, but don’t expect everyone to want to use your exact settings. This is for your personal environment.

Re: Show HN: Dotenv, if it is a Unix utility

#66

Earlier quoted context omitted.

What a tragic state of affairs. It's a shame that running modern software requires carefully packaging a virtual environment and then injecting a bunch of ugly global env vars. I still think Docker shouldn't exist. Programs should simply bundle their dependencies. Running a program should be as simple as download, unzip, run. No complex hierarchical container management needed. Alas I am not King.

Docker is "programs bundling their dependencies".

In an extremely heavyweight and needlessly convoluted way.

Re: Show HN: Dotenv, if it is a Unix utility

#68

Earlier quoted context omitted.

GPT-4 is not a static code analyser

These LLMs are not a lot of things that people think they can use them for, apparently. Therapist, search engine, cheap coding labour, the list goes on. These LLMs produce syntacticly valid language, no more. And information contained within is a by-product and not necessarily factual nor correct.

Still incredibly helpful. Therapy? Helped me a couple of times on some dark days. It’s not a replacement for it, but it helped me. Search engine? Why not? As long as you verify claims, you’re good, and especially nowadays the answers are preferable to whatever Google thinks should be on the first 10 pages (hint: it’s all crap). Cheap coding labour? Again, as long as you verify. A senior programmer can get a lot more done in a day this way.

It’s not necessarily factual or correct, no. But it’s incredibly helpful and useful. As always, the real answer is somewhere in the middle.

Just don’t ask it about politics. It’s so blatantly obviously biased.

Re: Show HN: Dotenv, if it is a Unix utility

#69

Earlier quoted context omitted.

I tend to agree, and we do this a lot actually. But it gets a little more complicated if you have several .env files. Would love to hear more about why dotenv is banned at your org though.

Because I banned it haha. There should not be more than one .env file. Our projects have a .env.example that has any overrides a dev might want to override but this list is kept intentionally very short. Meanwhile .env is noted in gitignore. I absolutely hate seeing an entire application configured with environment variables. Some? Sure, where it makes sense. Most? No, those should be in version control, secrets asid…

But then the problem is changing configs means building a new release, and needs code push access. Pretty much every config variable has env override in my apps - allows project owner to poke about in web UI without bothering me for changes.
Post reply on HN