-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Funky .env
Interpolation
#760
Comments
@shellscape Does You also probably shouldn't have |
I'm gonna push back on not having It also looks like
I stumbled across this issue allan2/dotenvy#11 which would be a nice thing to add to the documentation here as well. Most (if not all) Node-based users coming to moon are going to expect parity with https://github.com/motdotla/dotenv which the gold-standard for .env files in Node land. Having it documented that the parsing is more strict would be a net positive. The need for curlies for expansion should also probably go into the docs around |
The docs do mention the curly braces: https://moonrepo.dev/docs/config/project#envfile But I'll also update them with a mention about strictness. |
Looks like
I'd recommend changing that to:
Or some such, to make it more explicit. Folks familiar with bash expansion rules may think that's a helpful tip for those who don't know any better, knowing that regular parameter expansion doesn't require it. (we know I thought it was optional 😄 ) |
Yeah fair enough. I'll watch those dotenvy tickets, and if there's no movement for a while, maybe I'll just write an implementation myself. |
Dope, thanks man. |
Gonna close this since there's no action I can take right now. I did update the docs though. |
No worries, appreciate it. |
Describe the bug
We're seeing some interpolation from our
.env
file withenvFile
that's unexpected.Steps to reproduce
.env
file at the repo root, add this to it:moon.yml
in any project, add this to it:moon run [project]:foo
$NODE_ENV
to$DEPLOY_ENV
in the task and run againActual behavior:
That
_ENV
output looks like bad interpolation/variable expansion.Expected behavior
Screenshots
Environment
MacOS Ventura M2
Additional context
This is using the new support for
/.env
to point to the workspace root (thanks again!)The text was updated successfully, but these errors were encountered: