|
|
@@ -150,7 +150,19 @@ func (c *EngineClient) GenerateToPath(xmlfile string,dest_path string) {
|
|
|
} else if ft == "routers" {
|
|
|
os.MkdirAll(filepath.Dir(path), os.ModePerm)
|
|
|
ioutil.WriteFile(path, result.Data[i].Content, os.ModePerm)
|
|
|
- } else {
|
|
|
+ } else if ft =="sql"{
|
|
|
+ os.MkdirAll(filepath.Dir(path), os.ModePerm)
|
|
|
+ if strings.Index(path, "_gen.xml") > 0 {
|
|
|
+ ioutil.WriteFile(path, result.Data[i].Content, os.ModePerm)
|
|
|
+ } else {
|
|
|
+ _, err := os.Stat(path)
|
|
|
+ if err == nil {
|
|
|
+ //ioutil.WriteFile(path+"_new", result.Data[i].Content, os.ModePerm)
|
|
|
+ } else if os.IsNotExist(err) {
|
|
|
+ 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)
|
|
|
if err != nil {
|