adjust ocs

This commit is contained in:
A.Unger
2020-11-04 15:34:44 +01:00
parent 1c6ff61c53
commit cfa913e936
2 changed files with 13 additions and 13 deletions
+6 -6
View File
@@ -5,10 +5,10 @@ import (
"strings"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/ocs/pkg/config"
"github.com/owncloud/ocis/ocs/pkg/flagset"
"github.com/owncloud/ocis/ocs/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/spf13/viper"
)
@@ -33,7 +33,7 @@ func Execute() error {
Before: func(c *cli.Context) error {
cfg.Service.Version = version.String
return ParseConfig(c, cfg)
return nil
},
Commands: []*cli.Command{
@@ -88,22 +88,22 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
Msg("Continue without config")
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Err(err).
Msg("Unsupported config type")
Msg("unsupported config type")
default:
logger.Fatal().
Err(err).
Msg("Failed to read config")
Msg("failed to read config")
}
}
if err := viper.Unmarshal(&cfg); err != nil {
logger.Fatal().
Err(err).
Msg("Failed to parse config")
Msg("failed to parse config")
}
return nil