2021-08-03 09:55:21 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
2021-08-11 01:04:35 +00:00
|
|
|
"github.com/authelia/authelia/v4/internal/utils"
|
2021-08-03 09:55:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func newBuildInfoCmd() (cmd *cobra.Command) {
|
|
|
|
cmd = &cobra.Command{
|
2022-06-14 12:40:00 +00:00
|
|
|
Use: "build-info",
|
|
|
|
Short: cmdAutheliaBuildInfoShort,
|
|
|
|
Long: cmdAutheliaBuildInfoLong,
|
|
|
|
Example: cmdAutheliaBuildInfoExample,
|
|
|
|
RunE: cmdBuildInfoRunE,
|
|
|
|
Args: cobra.NoArgs,
|
2021-08-03 09:55:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return cmd
|
|
|
|
}
|
|
|
|
|
|
|
|
func cmdBuildInfoRunE(_ *cobra.Command, _ []string) (err error) {
|
|
|
|
_, err = fmt.Printf(fmtAutheliaBuild, utils.BuildTag, utils.BuildState, utils.BuildBranch, utils.BuildCommit,
|
|
|
|
utils.BuildNumber, runtime.GOOS, runtime.GOARCH, utils.BuildDate, utils.BuildExtra)
|
|
|
|
|
|
|
|
return err
|
|
|
|
}
|