fix(bonfire): recognise cobra's unknown command error once in Execute (IN-03, quick-261028-rqd)

This commit is contained in:
Jakub Zych
2026-10-28 20:23:39 +01:00
parent 8476a65aa0
commit 39c59b8329
5 changed files with 75 additions and 13 deletions

View File

@@ -54,10 +54,11 @@ func Execute(ctx context.Context, root *cobra.Command, args []string) int {
// fang hands over a colorprofile writer built from the
// environment only; RenderError unwraps it and applies
// --ansi and --no-ansi itself.
err = unknownCommand(root, args, err)
RenderError(w, name, wrongDirectory(name, err, args, ""), g)
}),
)
return exitCode(err)
return exitCode(unknownCommand(root, args, err))
}
// Fail renders err like Execute does and returns ExitFailure (ExitOK for a