1
0
mirror of https://github.com/alexellis/arkade.git synced 2022-05-07 18:22:49 +03:00
Files
arkade-kubernetes/cmd/version.go
Alex Ellis (OpenFaaS Ltd) be5a8cc594 Update thanks message to support message
Adds a message to downloads and K8s apps to show how to
support arkade.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-04-11 09:30:13 +01:00

55 lines
1.2 KiB
Go

// Copyright (c) arkade author(s) 2022. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package cmd
import (
"fmt"
"github.com/alexellis/arkade/pkg"
"github.com/morikuni/aec"
"github.com/spf13/cobra"
)
var (
Version string
GitCommit string
)
func PrintArkadeASCIIArt() {
arkadeLogo := aec.BlueF.Apply(arkadeFigletStr)
fmt.Print(arkadeLogo)
}
func MakeVersion() *cobra.Command {
var command = &cobra.Command{
Use: "version",
Short: "Print the version",
Example: ` arkade version`,
Aliases: []string{"v"},
SilenceUsage: false,
}
command.Run = func(cmd *cobra.Command, args []string) {
PrintArkadeASCIIArt()
if len(Version) == 0 {
fmt.Println("Version: dev")
} else {
fmt.Println("Version:", Version)
}
fmt.Println("Git Commit:", GitCommit)
fmt.Println("\n", aec.Bold.Apply(pkg.SupportMessageShort))
}
return command
}
const arkadeFigletStr = ` _ _
__ _ _ __| | ____ _ __| | ___
/ _` + "`" + ` | '__| |/ / _` + "`" + ` |/ _` + "`" + ` |/ _ \
| (_| | | | < (_| | (_| | __/
\__,_|_| |_|\_\__,_|\__,_|\___|
Open Source Marketplace For Developer Tools
`