chrly/internal/cmd/root.go

38 lines
616 B
Go
Raw Normal View History

package cmd
import (
"strings"
2023-12-13 21:59:12 +05:30
. "github.com/defval/di"
"github.com/spf13/cobra"
"github.com/spf13/viper"
2020-01-03 03:21:57 +05:30
"ely.by/chrly/internal/di"
"ely.by/chrly/internal/version"
)
var RootCmd = &cobra.Command{
2018-02-15 02:19:22 +05:30
Use: "chrly",
2024-02-01 12:28:26 +05:30
Short: "Implementation of the Minecraft skins system server",
2020-01-03 03:21:57 +05:30
Version: version.Version(),
}
func shouldGetContainer() *Container {
container, err := di.New()
if err != nil {
panic(err)
}
return container
}
2018-01-24 04:09:40 +05:30
func init() {
cobra.OnInitialize(initConfig)
}
func initConfig() {
viper.AutomaticEnv()
replacer := strings.NewReplacer(".", "_")
viper.SetEnvKeyReplacer(replacer)
}