Skip to content
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

Native support for .env files #1075

Open
mdonnalley opened this issue May 6, 2024 · 5 comments
Open

Native support for .env files #1075

mdonnalley opened this issue May 6, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@mdonnalley
Copy link
Contributor

Is your feature request related to a problem? Please describe.

@oclif/core should natively support .env files using process.loadEnvFile

Describe the solution you'd like

Call process.loadEnvFile at the beginning of run using path set in settings

The call should be gated by a check for the node version to avoid any runtime errors.

@mdonnalley mdonnalley added the enhancement New feature or request label May 6, 2024
Copy link

git2gus bot commented May 6, 2024

This issue has been linked to a new work item: W-15694504

@beforeoafterm
Copy link

Is there any workaround for supporting .env files in oclif?

@mdonnalley
Copy link
Contributor Author

You can you use dotenv in CLI's bin/run.js to load a .env file

@beforeoafterm
Copy link

You can you use dotenv in CLI's bin/run.js to load a .env file

@mdonnalley I see! I've already done this actually. 😄 But how can I make that work for the bin/run.cmd bin file for Windows?

@mdonnalley
Copy link
Contributor Author

bin/run.cmd just runs bin/run.js so whatever you do in there should also work for windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants