Skip to content

Commit

Permalink
Comments and docs
Browse files Browse the repository at this point in the history
...
  • Loading branch information
helje5 committed Dec 14, 2024
1 parent c5e1b30 commit a23953f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declarative DSL to setup MacroExpress routes.

The Macro [Examples](https://github.com/Macro-swift/Examples) package
contains a few examples which all can run straight from the source as
swift-sh scripts.
[swift-sh](https://github.com/mxcl/swift-sh) scripts.

```swift
#!/usr/bin/swift sh
Expand Down Expand Up @@ -80,5 +80,10 @@ app.listen(1337)
We like feedback, GitHub stars, cool contract work,
presumably any form of praise you can think of.

There is a `#microexpress` channel on the
[Noze.io Slack](http://slack.noze.io/). Feel free to join!
**Want to support my work**?
Buy an app:
[Code for SQLite3](https://apps.apple.com/us/app/code-for-sqlite3/id1638111010),
[Past for iChat](https://apps.apple.com/us/app/past-for-ichat/id1554897185),
[SVG Shaper](https://apps.apple.com/us/app/svg-shaper-for-swiftui/id1566140414),
[HMScriptEditor](https://apps.apple.com/us/app/hmscripteditor/id1483239744).
You don't have to use it! 😀
16 changes: 14 additions & 2 deletions Sources/dotenv/dotenv.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// MacroExpress
//
// Created by Helge Heß on 02.07.20.
// Copyright © 2020 ZeeZide GmbH. All rights reserved.
// Copyright © 2020-2024 ZeeZide GmbH. All rights reserved.
//

#if os(Linux)
Expand All @@ -17,13 +17,25 @@ import func MacroCore.__dirname
import func fs.accessSync
import let fs.R_OK

/**
* How to use:
*
* ```swift
* import dotenv
*
* dotenv.config()
* ```
*
* This reads the `.env` file (located using `__dirname`),
* and adds the contents to the environment of the running process.
*/
public enum dotenv {}

public extension dotenv {

#if swift(>=5.3) // oh this mess
/**
* Read the .env config file, apply it to the environment, and return the
* Read the .env config file, apply it on the environment, and return the
* parsed values.
*
* Important: Remember to call this as early as possible, otherwise Foundation
Expand Down

0 comments on commit a23953f

Please sign in to comment.