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

Check if an environment variable is set #452

Open
9999years opened this issue Feb 29, 2024 · 1 comment · May be fixed by #454
Open

Check if an environment variable is set #452

9999years opened this issue Feb 29, 2024 · 1 comment · May be fixed by #454

Comments

@9999years
Copy link

In Bash, it's very common to check if an environment is set and non-empty with [[ -n "${VAR:-}" ]]. We should provide helpers for this, like so:

hasEnv :: Text -> IO Bool
hasEnv = not . missingEnv

missingEnv :: Text -> IO Bool
missingEnv name = null $ fromMaybe "" $ need name
@Gabriella439
Copy link
Owner

Let me know if #454 looks okay to you

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

Successfully merging a pull request may close this issue.

2 participants