Skip to content

Commit

Permalink
Add version as input to Bitrise CLI header (#827)
Browse files Browse the repository at this point in the history
* Add version as input to BitriseCLI header

* Remove version fallback
  • Loading branch information
zsolt-vicze authored Nov 17, 2022
1 parent 55ac240 commit 982943c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -169,15 +168,15 @@ func (m *defaultLogger) PrintBitriseStartedEvent(plan models.WorkflowRunPlan) {
}

// PrintBitriseASCIIArt ...
func (m *defaultLogger) PrintBitriseASCIIArt() {
func (m *defaultLogger) PrintBitriseASCIIArt(version string) {
m.Print(`
██████╗ ██╗████████╗██████╗ ██╗███████╗███████╗
██╔══██╗██║╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝
██████╔╝██║ ██║ ██████╔╝██║███████╗█████╗
██╔══██╗██║ ██║ ██╔══██╗██║╚════██║██╔══╝
██████╔╝██║ ██║ ██║ ██║██║███████║███████╗
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝`)
m.Printf("version: %s", version.VERSION)
m.Printf("version: %s", version)
m.Print()
}

Expand Down
3 changes: 2 additions & 1 deletion log/log_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -104,7 +105,7 @@ func PrintBitriseStartedEvent(plan models.WorkflowRunPlan) {
}

func PrintBitriseASCIIArt() {
getGlobalLogger().PrintBitriseASCIIArt()
getGlobalLogger().PrintBitriseASCIIArt(version.VERSION)
}

func PrintStepStartedEvent(params StepStartedParams) {
Expand Down
2 changes: 1 addition & 1 deletion log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ type Logger interface {
PrintBitriseStartedEvent(plan models.WorkflowRunPlan)
PrintStepStartedEvent(params StepStartedParams)
PrintStepFinishedEvent(params StepFinishedParams)
PrintBitriseASCIIArt()
PrintBitriseASCIIArt(version string)
}

0 comments on commit 982943c

Please sign in to comment.