@dynamicMemberLookup
interface for environment variables.
Add to your project via Swift package manager:
.package("https://github.com/nikstar/Env.git", from: "2.0.0")
guard let home = Env.HOME else { return }
Env.PATH! += ":\(home)/bin"
Unsetting varibles:
Env.LC_LOCALE = nil
Throwing access:
do {
let v = try Env.get("NOTAVAR")
} catch {
print(error) // "environment variable missing: NOTAVAR"
}