Adds a warning when running a debug build (#201)

This PR adds a warning that the performance may be degraded when running
a debug build.

Debug build:
```
% bin/container run -it --rm alpine:latest date
Warning! Running debug build. Performance may be degraded.
Fri Jun 13 18:10:35 PDT 2025
```

Release build:
```
% bin/container run -it --rm alpine:latest date
Fri Jun 13 18:10:35 PDT 2025
```
This commit is contained in:
Dmitry Kovba
2025-06-13 19:48:59 -07:00
committed by GitHub
parent 51c1b879d2
commit 555dbfc9fa
+7
View File
@@ -150,6 +150,13 @@ struct Application: AsyncParsableCommand {
public static func main() async throws {
restoreCursorAtExit()
#if DEBUG
let warning = "Running debug build. Performance may be degraded."
let formattedWarning = "\u{001B}[33mWarning!\u{001B}[0m \(warning)\n"
let warningData = Data(formattedWarning.utf8)
FileHandle.standardError.write(warningData)
#endif
let fullArgs = CommandLine.arguments
let args = Array(fullArgs.dropFirst())