Browse Source

auth work

reid 2 năm trước cách đây
mục cha
commit
6618165d85
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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)
 	}