Skip to content

Commit 2e182e6

Browse files
committed
Have Environment.set actually set the environment
1 parent 1bfd1f4 commit 2e182e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/Hummingbird/Environment.swift

+5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ public struct Environment: Sendable, Decodable, ExpressibleByDictionaryLiteral {
9292
/// - value: Environment variable name value
9393
public mutating func set(_ s: String, value: String?) {
9494
self.values[s.lowercased()] = value
95+
if let value {
96+
setenv(s, value, 1)
97+
} else {
98+
unsetenv(s)
99+
}
95100
}
96101

97102
/// Merge two environment variable sets together and return result

0 commit comments

Comments
 (0)