Skip to content

Instantly share code, notes, and snippets.

@LucianoPAlmeida
Created November 7, 2018 03:21
Show Gist options
  • Save LucianoPAlmeida/8f9b538d71e7abb546eb42d68e417a65 to your computer and use it in GitHub Desktop.
Save LucianoPAlmeida/8f9b538d71e7abb546eb42d68e417a65 to your computer and use it in GitHub Desktop.
struct Environment {
static var mySecretKey: String = Environment.variable(named: "SECRET_ENVIRONMENT_KEY") ?? CI.mySecretKey
static func variable(named name: String) -> String? {
let processInfo = ProcessInfo.processInfo
guard let value = processInfo.environment[name] else {
return nil
}
return value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment