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

Macro alternative to fallback to regular env #76

Open
ShayBox opened this issue May 30, 2023 · 0 comments
Open

Macro alternative to fallback to regular env #76

ShayBox opened this issue May 30, 2023 · 0 comments

Comments

@ShayBox
Copy link

ShayBox commented May 30, 2023

I use dotenvy! for development to load from .env and env! in production to load from regular env (GitHub Workflows), now I have a feature flag to switch between the two but it's very inconvenient and repetitive.

#[cfg(feature = "production")]
const EXAMPLE_ENV: &str = dotenv!("EXAMPLE_ENV");
#[cfg(not(feature = "production"))]
const EXAMPLE_ENV: &str = env!("EXAMPLE_ENV");

Having a macro that falls back to the regular env would be nice.

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

No branches or pull requests

1 participant