feat(clustertool): setup logo and version displaying

This commit is contained in:
Kjeld Schouten
2024-10-22 13:23:56 +02:00
parent 8582c6434a
commit 631e18a0f0
3 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ builds:
- amd64
- arm64
ldflags:
- -s -w -X github.com/truecharts/public/clustertool/cmd.version={{.Version}} # Adjust path if necessary
- -s -w -X github.com/truecharts/public/clustertool/main.version={{.Version}} # Adjust path if necessary
archives:
- name_template: "{{.ProjectName}}_{{ .Version }}_{{.Os}}_{{.Arch}}"
checksum:
+5
View File
@@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"time"
@@ -16,6 +17,8 @@ import (
ctrllogzap "sigs.k8s.io/controller-runtime/pkg/log/zap"
)
var version = "dev"
func main() {
// Configure zerolog
zerolog.DurationFieldUnit = time.Second
@@ -68,6 +71,8 @@ func main() {
// Set controller-runtime logger to use zap
ctrlLogger := ctrllogzap.New(ctrllogzap.UseDevMode(true), ctrllogzap.Level(zapLevel))
ctrllog.SetLogger(ctrlLogger)
fmt.Printf("\n%s\n", helper.Logo)
fmt.Printf("---\nClustertool Version: %s\n---\n", version)
embed.AllToCache()
+13
View File
@@ -31,4 +31,17 @@ var (
IndexCache = "./index_cache"
GpgDir = ".cr-gpg" // Adjust the path based on your project structure
Logo = `
_______ _____ _ _
|__ __| / ____| | | |
| |_ __ _ _ ___| | | |__ __ _ _ __| |_ ___
| | '__| | | |/ _ \ | | '_ \ / _` + "`" + ` | '__| __/ __|
| | | | |_| | __/ |____| | | | (_| | | | |_\__ \
|_|_| \__,_|\___|\_____|_| |_|\__,_|_| \__|___/
_______ __ ______ __
/ ___/ /_ _____ / /____ ___/_ __/__ ___ / /
/ /__/ / // (_-</ __/ -_) __// / / _ \/ _ \/ /
\___/_/\_,_/___/\__/\__/_/ /_/ \___/\___/_/
`
)