From 6ef412a50cb0e653ac3559d55527b2db4a8f46f4 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Tue, 8 Oct 2024 13:49:28 +1100 Subject: [PATCH] fix: schema diff missing output fixes: #3031 --- frontend/cli/cmd_schema_diff.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/cli/cmd_schema_diff.go b/frontend/cli/cmd_schema_diff.go index 028763b3ab..569bceffe6 100644 --- a/frontend/cli/cmd_schema_diff.go +++ b/frontend/cli/cmd_schema_diff.go @@ -21,6 +21,7 @@ import ( "github.com/TBD54566975/ftl/internal/projectconfig" "github.com/TBD54566975/ftl/internal/rpc" "github.com/TBD54566975/ftl/internal/schema" + "github.com/TBD54566975/ftl/internal/terminal" "github.com/TBD54566975/ftl/internal/watch" ) @@ -78,6 +79,9 @@ func (d *schemaDiffCmd) Run(ctx context.Context, currentURL *url.URL, projConfig // Similar to the `diff` command, exit with 1 if there are differences. if diff != "" { + // Unfortunately we need to close the terminal before exit to make sure the output is printed + // This is only applicable when we explicitly call os.Exit + terminal.FromContext(ctx).Close() os.Exit(1) }