Gabriella439 / Gabriella439/turtle

Check if an environment variable is set

Open
#452 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
978
Forks
94
PR merge metrics
No merged PRs in 30d

Description

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:

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

missingEnv :: Text -> IO Bool
missingEnv name = null $ fromMaybe "" $ need name
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.