reid 2 rokov pred
rodič
commit
6618165d85
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      config/config.go

+ 5 - 1
config/config.go

@@ -169,6 +169,10 @@ func UpdateConf(values map[string]interface{}) error {
 }
 
 func persistConf(configMap map[string]interface{}) error {
+	if BasePath == "" {
+		// default base path
+		BasePath = "/opt/nativeplanet/groundseg"
+	}
 	// marshal and persist it
 	updatedJSON, err := json.MarshalIndent(configMap, "", "    ")
 	if err != nil {
@@ -179,7 +183,7 @@ func persistConf(configMap map[string]interface{}) error {
 		return fmt.Errorf("Error updating global config: %v", err)
 	}
 	// write to disk
-	Logger.Info("Persisting configuration to disk %v",string(updatedJSON))
+	Logger.Info("Persisting configuration to disk %v",string(updatedJson))
 	if err := ioutil.WriteFile(confPath, updatedJSON, 0644); err != nil {
 		return fmt.Errorf("Error writing to file: %v", err)
 	}