Skip to content

Commit b82ab2d

Browse files
committed
Inject env variable globally
1 parent 7ac1153 commit b82ab2d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/App/Core/Dependencies/ShellClient.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ extension ShellClient: DependencyKey {
4242
run: { command, path, environment in
4343
@Dependency(\.logger) var logger
4444
do {
45-
let res = try await ShellOut.shellOut(to: command,
46-
at: path,
47-
logger: logger,
48-
environment: environment)
45+
let res = try await ShellOut.shellOut(
46+
to: command,
47+
at: path,
48+
logger: logger,
49+
environment: (environment ?? [:]).merging(["SPI_PROCESSING": "1"], uniquingKeysWith: { $1 })
50+
)
4951
if !res.stderr.isEmpty {
5052
logger.warning("stderr: \(res.stderr)")
5153
}

0 commit comments

Comments
 (0)