-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.go
46 lines (39 loc) 路 789 Bytes
/
version.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2023 Clivern. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package cmd
import (
"embed"
"fmt"
"github.com/spf13/cobra"
)
var (
// Version buildinfo item
Version = "dev"
// Commit buildinfo item
Commit = "none"
// Date buildinfo item
Date = "unknown"
// BuiltBy buildinfo item
BuiltBy = "unknown"
)
// Static embedded files
var Static embed.FS
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(
fmt.Sprintf(
`Current Sloth Version %v Commit %v, Built @%v By %v.`,
Version,
Commit,
Date,
BuiltBy,
),
)
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}