目录
目录README.md

Environmentalism

Build Status

Simple package that loads variables from your DotEnv files.

Requirements

  • MacOS or Linux
  • Swift 4+

Installation

You can grab this package through Swift Package Manager:

import PackageDescription

let package = Package(
    name: "Example",
    products: [
      .executable(name: "Example", targets: ["Example"])
    ],
    dependencies: [
      .package(url: "https://github.com/fborges/Environmentalism", from: "1.0.0")
    ],
    targets: [
        .target(
            name: "Example",
            dependencies: ["Environmentalism"]),
    ]
)

Usage

This package has basically One struct that brings up the stuff for you:

import Environmentalism

// Load environment variables from file at specified URL
let env = try! Environment(url: url)

// Supports subscripting
let victories = env["BRAZIL_WORLD_CHAMPION"] -> "5"

// Push all key-value pairs into actual environment variables
env.commit()

Further improvements

See Issues.

License

MIT License

关于
46.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号