From 982943ce6bc307ec63924116687e6d7facddc656 Mon Sep 17 00:00:00 2001 From: zsolt-vicze <104844424+zsolt-vicze@users.noreply.github.com> Date: Thu, 17 Nov 2022 09:45:26 +0000 Subject: [PATCH] Add version as input to Bitrise CLI header (#827) * Add version as input to BitriseCLI header * Remove version fallback --- log/log.go | 7 +++---- log/log_functions.go | 3 ++- log/logger.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/log/log.go b/log/log.go index 79d0d79e4..4de5f5c89 100644 --- a/log/log.go +++ b/log/log.go @@ -8,7 +8,6 @@ import ( "github.com/bitrise-io/bitrise/log/corelog" "github.com/bitrise-io/bitrise/models" - "github.com/bitrise-io/bitrise/version" ) const rfc3339MicroTimeLayout = "2006-01-02T15:04:05.999999Z07:00" @@ -144,7 +143,7 @@ func (m *defaultLogger) PrintBitriseStartedEvent(plan models.WorkflowRunPlan) { EventType: "bitrise_started", }) } else { - m.PrintBitriseASCIIArt() + m.PrintBitriseASCIIArt(plan.Version) m.Warnf("CI mode: %v", plan.CIMode) m.Warnf("PR mode: %v", plan.PRMode) m.Warnf("Debug mode: %v", plan.DebugMode) @@ -169,7 +168,7 @@ func (m *defaultLogger) PrintBitriseStartedEvent(plan models.WorkflowRunPlan) { } // PrintBitriseASCIIArt ... -func (m *defaultLogger) PrintBitriseASCIIArt() { +func (m *defaultLogger) PrintBitriseASCIIArt(version string) { m.Print(` ██████╗ ██╗████████╗██████╗ ██╗███████╗███████╗ ██╔══██╗██║╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝ @@ -177,7 +176,7 @@ func (m *defaultLogger) PrintBitriseASCIIArt() { ██╔══██╗██║ ██║ ██╔══██╗██║╚════██║██╔══╝ ██████╔╝██║ ██║ ██║ ██║██║███████║███████╗ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝`) - m.Printf("version: %s", version.VERSION) + m.Printf("version: %s", version) m.Print() } diff --git a/log/log_functions.go b/log/log_functions.go index 4e4d310fb..a9fccd199 100644 --- a/log/log_functions.go +++ b/log/log_functions.go @@ -6,6 +6,7 @@ import ( "github.com/bitrise-io/bitrise/log/corelog" "github.com/bitrise-io/bitrise/models" + "github.com/bitrise-io/bitrise/version" ) var globalLogger *defaultLogger @@ -104,7 +105,7 @@ func PrintBitriseStartedEvent(plan models.WorkflowRunPlan) { } func PrintBitriseASCIIArt() { - getGlobalLogger().PrintBitriseASCIIArt() + getGlobalLogger().PrintBitriseASCIIArt(version.VERSION) } func PrintStepStartedEvent(params StepStartedParams) { diff --git a/log/logger.go b/log/logger.go index e23b88645..7d2eb008a 100644 --- a/log/logger.go +++ b/log/logger.go @@ -25,5 +25,5 @@ type Logger interface { PrintBitriseStartedEvent(plan models.WorkflowRunPlan) PrintStepStartedEvent(params StepStartedParams) PrintStepFinishedEvent(params StepFinishedParams) - PrintBitriseASCIIArt() + PrintBitriseASCIIArt(version string) }