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
|
|
|
)
|
|
|
|
|
2022-12-22 00:21:29 +00:00
|
|
|
func newBuildInfoCmd(ctx *CmdCtx) (cmd *cobra.Command) {
|
2021-08-03 09:55:21 +00:00
|
|
|
cmd = &cobra.Command{
|
2022-06-14 12:40:00 +00:00
|
|
|
Use: "build-info",
|
|
|
|
Short: cmdAutheliaBuildInfoShort,
|
|
|
|
Long: cmdAutheliaBuildInfoLong,
|
|
|
|
Example: cmdAutheliaBuildInfoExample,
|
2022-12-22 00:21:29 +00:00
|
|
|
RunE: ctx.BuildInfoRunE,
|
2022-06-14 12:40:00 +00:00
|
|
|
Args: cobra.NoArgs,
|
2022-09-01 02:24:47 +00:00
|
|
|
|
|
|
|
DisableAutoGenTag: true,
|
2021-08-03 09:55:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return cmd
|
|
|
|
}
|
|
|
|
|
2022-12-22 00:21:29 +00:00
|
|
|
// BuildInfoRunE is the RunE for the authelia build-info command.
|
|
|
|
func (ctx *CmdCtx) BuildInfoRunE(_ *cobra.Command, _ []string) (err error) {
|
2021-08-03 09:55:21 +00:00
|
|
|
_, err = fmt.Printf(fmtAutheliaBuild, utils.BuildTag, utils.BuildState, utils.BuildBranch, utils.BuildCommit,
|
2023-04-13 12:44:10 +00:00
|
|
|
utils.BuildDate, utils.BuildNumber, runtime.GOOS, runtime.GOARCH, runtime.Version(), utils.BuildExtra)
|
2021-08-03 09:55:21 +00:00
|
|
|
|
|
|
|
return err
|
|
|
|
}
|