Open noahehall opened 3 years ago
here is my workaround until i find a better approach
I had to rely on dotenv, as env-cmd.GetEnvFromVars
thing returns a promise, and I cant use top-level await when outputing to cjs via esbuild (thus i cant use promises without other headaches)
Any guidance on this?
Hi,
did you try --no-override option ?
regards,
I just used the --no-override
option as suggested by @fidgi and it worked like a charm.
Just make sure to set the variable(s) on the same shell you're executing env-cmd
or as an environment variable:
ABC=123 env-cmd --no-override ...
export ABC=123 && env-cmd --no-override ...
ABC=123 && env-cmd --no-override ...
won't work, as it sets ABC in one shell and runs env-cmd on another.
I have a base .env file that I need to override without creating a gizillion other env files, or creating an envfile with superhuman capabilities
ive tried
NODE_ENV=production env-cmd runpoop.js
however it doesnt replace the nodenev in the .env file
How do I do this? is it possible? here is the specific npm script im trying to run