mirror of
https://github.com/mudler/luet.git
synced 2025-09-01 15:18:28 +00:00
Annotate git hash and time in displayed version
This commit is contained in:
10
cmd/root.go
10
cmd/root.go
@@ -42,12 +42,20 @@ const (
|
||||
LuetEnvPrefix = "LUET"
|
||||
)
|
||||
|
||||
// Build time and commit information.
|
||||
//
|
||||
// ⚠️ WARNING: should only be set by "-ldflags".
|
||||
var (
|
||||
BuildTime string
|
||||
BuildCommit string
|
||||
)
|
||||
|
||||
// RootCmd represents the base command when called without any subcommands
|
||||
var RootCmd = &cobra.Command{
|
||||
Use: "luet",
|
||||
Short: "Package manager for the XXth century!",
|
||||
Long: `Package manager which uses containers to build packages`,
|
||||
Version: LuetCLIVersion,
|
||||
Version: fmt.Sprintf("%s-g%s %s", LuetCLIVersion, BuildCommit, BuildTime),
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
err := LoadConfig(config.LuetCfg)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user