2021-08-03 16:55:21 +07:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
2021-08-11 08:04:35 +07:00
|
|
|
"github.com/authelia/authelia/v4/internal/utils"
|
2021-08-03 16:55:21 +07:00
|
|
|
)
|
|
|
|
|
|
|
|
func newBuildInfoCmd() (cmd *cobra.Command) {
|
|
|
|
cmd = &cobra.Command{
|
2022-06-14 19:40:00 +07:00
|
|
|
Use: "build-info",
|
|
|
|
Short: cmdAutheliaBuildInfoShort,
|
|
|
|
Long: cmdAutheliaBuildInfoLong,
|
|
|
|
Example: cmdAutheliaBuildInfoExample,
|
|
|
|
RunE: cmdBuildInfoRunE,
|
|
|
|
Args: cobra.NoArgs,
|
2021-08-03 16:55:21 +07: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
|
|
|
|
}
|