Adopt the native CommandKit application boundary

This commit is contained in:
2026-11-20 04:13:05 +00:00
parent 86692d58f9
commit a3c58141a0
25 changed files with 420 additions and 148 deletions

View File

@@ -0,0 +1,24 @@
package app
import (
"context"
"io"
"go.maximumdirect.net/commandkit"
)
func executeForTest(args []string, stdout, stderr io.Writer) int {
return Execute(context.Background(), args, commandkit.Streams{Out: stdout, Err: stderr}).Status
}
func executeWithPipelineExecutor(args []string, stdout, stderr io.Writer, executor pipelineExecutor) int {
return executeWithDependencies(args, stdout, stderr, commandDependencies{}, executor)
}
func executeWithDependencies(args []string, stdout, stderr io.Writer, deps commandDependencies, executor pipelineExecutor) int {
application, err := newApplication(deps, executor)
if err != nil {
panic(err)
}
return application.Execute(context.Background(), args, commandkit.Streams{Out: stdout, Err: stderr}).Status
}