authelia/internal/commands/build-info.go
James Elliott 5304178165
ci: add dedicated authelia-gen command (#3463)
Adds a dedicated authelia code/doc gen command.
2022-06-14 22:40:00 +10:00

31 lines
686 B
Go

package commands
import (
"fmt"
"runtime"
"github.com/spf13/cobra"
"github.com/authelia/authelia/v4/internal/utils"
)
func newBuildInfoCmd() (cmd *cobra.Command) {
cmd = &cobra.Command{
Use: "build-info",
Short: cmdAutheliaBuildInfoShort,
Long: cmdAutheliaBuildInfoLong,
Example: cmdAutheliaBuildInfoExample,
RunE: cmdBuildInfoRunE,
Args: cobra.NoArgs,
}
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
}