Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #990 from yunfeiyanggzq/d
Browse files Browse the repository at this point in the history
bugfix:fix debug mod and homedir config in yaml
  • Loading branch information
starnop authored Oct 22, 2019
2 parents f4870ac + fe078b1 commit 0f78781
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cmd/supernode/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ var rootCmd = &cobra.Command{
Args: cobra.NoArgs,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
// load config file.
if err := readConfigFile(supernodeViper, cmd); err != nil {
return errors.Wrap(err, "read config file")
}

// get config from viper.
cfg, err := getConfigFromViper(supernodeViper)
if err != nil {
return errors.Wrap(err, "get config from viper")
}

// create home dir
if err := fileutils.CreateDirectory(supernodeViper.GetString("base.homeDir")); err != nil {
return fmt.Errorf("failed to create home dir %s: %v", supernodeViper.GetString("base.homeDir"), err)
Expand All @@ -67,17 +78,6 @@ var rootCmd = &cobra.Command{
return err
}

// load config file
if err := readConfigFile(supernodeViper, cmd); err != nil {
return errors.Wrap(err, "read config file")
}

// get config from viper
cfg, err := getConfigFromViper(supernodeViper)
if err != nil {
return errors.Wrap(err, "get config from viper")
}

// set supernode advertise ip
if stringutils.IsEmptyStr(cfg.AdvertiseIP) {
if err := setAdvertiseIP(cfg); err != nil {
Expand Down

0 comments on commit 0f78781

Please sign in to comment.