2017-06-30 18:40:25 +03:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2018-02-15 14:20:17 +03:00
|
|
|
"strings"
|
2017-06-30 18:40:25 +03:00
|
|
|
|
2023-12-13 17:29:12 +01:00
|
|
|
. "github.com/defval/di"
|
2017-06-30 18:40:25 +03:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/viper"
|
2020-01-03 00:51:57 +03:00
|
|
|
|
2024-02-01 08:12:34 +01:00
|
|
|
"ely.by/chrly/internal/di"
|
|
|
|
"ely.by/chrly/internal/version"
|
2017-06-30 18:40:25 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var RootCmd = &cobra.Command{
|
2018-02-14 23:49:22 +03:00
|
|
|
Use: "chrly",
|
2024-02-01 07:58:26 +01:00
|
|
|
Short: "Implementation of the Minecraft skins system server",
|
2020-01-03 00:51:57 +03:00
|
|
|
Version: version.Version(),
|
2017-06-30 18:40:25 +03:00
|
|
|
}
|
|
|
|
|
2020-04-19 02:31:09 +03:00
|
|
|
func shouldGetContainer() *Container {
|
|
|
|
container, err := di.New()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return container
|
|
|
|
}
|
|
|
|
|
2018-01-24 01:39:40 +03:00
|
|
|
func init() {
|
2017-06-30 18:40:25 +03:00
|
|
|
cobra.OnInitialize(initConfig)
|
|
|
|
}
|
|
|
|
|
|
|
|
func initConfig() {
|
2017-08-15 00:43:31 +03:00
|
|
|
viper.AutomaticEnv()
|
2018-02-15 14:20:17 +03:00
|
|
|
replacer := strings.NewReplacer(".", "_")
|
|
|
|
viper.SetEnvKeyReplacer(replacer)
|
2017-06-30 18:40:25 +03:00
|
|
|
}
|