mirror of
https://github.com/elyby/chrly.git
synced 2024-12-27 07:20:25 +05:30
38 lines
616 B
Go
38 lines
616 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
. "github.com/defval/di"
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
|
|
"ely.by/chrly/internal/di"
|
|
"ely.by/chrly/internal/version"
|
|
)
|
|
|
|
var RootCmd = &cobra.Command{
|
|
Use: "chrly",
|
|
Short: "Implementation of the Minecraft skins system server",
|
|
Version: version.Version(),
|
|
}
|
|
|
|
func shouldGetContainer() *Container {
|
|
container, err := di.New()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return container
|
|
}
|
|
|
|
func init() {
|
|
cobra.OnInitialize(initConfig)
|
|
}
|
|
|
|
func initConfig() {
|
|
viper.AutomaticEnv()
|
|
replacer := strings.NewReplacer(".", "_")
|
|
viper.SetEnvKeyReplacer(replacer)
|
|
}
|