-
Notifications
You must be signed in to change notification settings - Fork 1
/
logo.go
32 lines (25 loc) · 794 Bytes
/
logo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package uncors
import (
"strings"
"github.com/evg4b/uncors/internal/helpers"
"github.com/pterm/pterm"
"github.com/pterm/pterm/putils"
)
func Logo(version string) string {
logoLength := 51
versionLine := strings.Repeat(" ", logoLength)
versionSuffix := helpers.Sprintf("version: %s", version)
versionPrefix := versionLine[:logoLength-len(versionSuffix)]
logo, _ := pterm.DefaultBigText.
WithLetters(
putils.LettersFromStringWithStyle("UN", pterm.NewStyle(pterm.FgRed)),
putils.LettersFromStringWithRGB("CORS", pterm.NewRGB(255, 215, 0)), //nolint: gomnd
).
Srender()
var builder strings.Builder
helpers.FPrintln(&builder)
helpers.FPrint(&builder, logo)
helpers.FPrint(&builder, versionPrefix, versionSuffix)
helpers.FPrintln(&builder)
return builder.String()
}