show config file

This commit is contained in:
zu1k
2020-08-22 15:30:19 +08:00
parent 20b6066c6a
commit 03a9795ae2
2 changed files with 3 additions and 1 deletions

View File

@@ -71,6 +71,8 @@ func FetchNewConfigFileThenInit() {
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
err = yaml.Unmarshal(body, &config.SourceConfig)
if err != nil {
return

View File

@@ -52,10 +52,10 @@ func main() {
}
func initConfigFile(path string) {
fmt.Println("Config file:", path)
if strings.HasPrefix(path, "http") {
config.Url = path
config.NeedFetch = true
app.FetchNewConfigFileThenInit()
} else {
err := app.InitConfigAndGetters(configFilePath)
if err != nil {