|
|
@@ -146,13 +146,8 @@ func (c *EngineClient) Generate(xmlfile string) {
|
|
|
}
|
|
|
}
|
|
|
} else if ft == "routers" {
|
|
|
- _, err := os.Stat(path)
|
|
|
- if err == nil {
|
|
|
- fmt.Println(path + "已经存在")
|
|
|
- ioutil.WriteFile(path+"_new", result.Data[i].Content, os.ModePerm)
|
|
|
- } else {
|
|
|
- ioutil.WriteFile(path, result.Data[i].Content, os.ModePerm)
|
|
|
- }
|
|
|
+ os.MkdirAll(filepath.Dir(path), os.ModePerm)
|
|
|
+ ioutil.WriteFile(path, result.Data[i].Content, os.ModePerm)
|
|
|
} else {
|
|
|
os.MkdirAll(filepath.Dir(path), os.ModePerm)
|
|
|
err := ioutil.WriteFile(path, result.Data[i].Content, os.ModePerm)
|