From 219dc747e9b4c37044932be2fd96d37260ef1e56 Mon Sep 17 00:00:00 2001 From: gwen windflower Date: Thu, 18 Apr 2024 09:11:39 -0500 Subject: [PATCH] style(progressbar): Make full width This makes the progress bar full width and combines the two finished printed strings into one Printf call. --- main.go | 3 +-- sourcerer/put_columns_on_tables.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index eaf3ced..80e2da8 100644 --- a/main.go +++ b/main.go @@ -73,6 +73,5 @@ func main() { log.Fatalf("Error writing files: %v\n", err) } e.ProcessingElapsed = time.Since(e.ProcessingStart).Seconds() - fmt.Printf("\nšŸ Done in %.1fs fetching data and %.1fs writing files! ", e.DbElapsed, e.ProcessingElapsed) - fmt.Printf("\nYour YAML and SQL files are in the %s directory.", formResponse.BuildDir) + fmt.Printf("\nšŸ Done in %.1fs fetching data and %.1fs writing files!\nYour YAML and SQL files are in the %s directory.", e.DbElapsed, e.ProcessingElapsed, formResponse.BuildDir) } diff --git a/sourcerer/put_columns_on_tables.go b/sourcerer/put_columns_on_tables.go index 9eb8daa..f0f5325 100644 --- a/sourcerer/put_columns_on_tables.go +++ b/sourcerer/put_columns_on_tables.go @@ -22,11 +22,11 @@ func PutColumnsOnTables(ctx context.Context, ts shared.SourceTables, dbc DbConn) mutex := sync.Mutex{} bar := progressbar.NewOptions(len(ts.SourceTables), - progressbar.OptionSetWidth(5), progressbar.OptionShowCount(), progressbar.OptionShowElapsedTimeOnFinish(), + progressbar.OptionFullWidth(), progressbar.OptionEnableColorCodes(true), - progressbar.OptionSetDescription("[magenta]šŸŽļøāœØ Getting warehouse metadata...[reset]"), + progressbar.OptionSetDescription("šŸŽļøāœØ"), ) var wg sync.WaitGroup wg.Add(len(ts.SourceTables))