cmd: refactor tui and launch (#14609)

This commit is contained in:
Parth Sareen
2026-03-12 18:39:06 -07:00
committed by GitHub
parent a6b27d776b
commit af5f7c0a9e
42 changed files with 5245 additions and 3328 deletions

View File

@@ -0,0 +1,21 @@
package launch
import "strings"
// OverrideIntegration replaces one registry entry's runner for tests and returns a restore function.
func OverrideIntegration(name string, runner Runner) func() {
spec, err := LookupIntegrationSpec(name)
if err != nil {
key := strings.ToLower(name)
integrationSpecsByName[key] = &IntegrationSpec{Name: key, Runner: runner}
return func() {
delete(integrationSpecsByName, key)
}
}
original := spec.Runner
spec.Runner = runner
return func() {
spec.Runner = original
}
}