Config: Add cluster instance bootstrap and registration hook #98

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-09-16 23:30:23 +02:00
parent ec8ea96f31
commit e1d031bea7
19 changed files with 912 additions and 112 deletions

View File

@@ -79,8 +79,12 @@ func RunWithTestContext(cmd *cli.Command, args []string) (output string, err err
// a nil pointer panic in the "github.com/urfave/cli/v2" package.
cmd.HideHelp = true
// Run command with test context.
// Run command via cli.Command.Run but neutralize os.Exit so ExitCoder
// errors don't terminate the test binary.
output = capture.Output(func() {
origExiter := cli.OsExiter
cli.OsExiter = func(int) {}
defer func() { cli.OsExiter = origExiter }()
err = cmd.Run(ctx, args...)
})