|
@@ -317,12 +317,22 @@ func scanControllers(ctrldir string) ([]XmlController, error){
|
|
|
fmt.Println("controller xml file " + ctrlfile + " does not exist")
|
|
fmt.Println("controller xml file " + ctrlfile + " does not exist")
|
|
|
return controllers, err
|
|
return controllers, err
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ ctrlfile = strings.Replace(ctrlfile, "\\", "/", -1)
|
|
|
|
|
+ arr := strings.Split(ctrlfile, "/")
|
|
|
|
|
+
|
|
|
bytess, _ := ioutil.ReadFile(ctrlfile)
|
|
bytess, _ := ioutil.ReadFile(ctrlfile)
|
|
|
err = xml.Unmarshal(bytess, &ctrl)
|
|
err = xml.Unmarshal(bytess, &ctrl)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
fmt.Println("xml.Unmarshal(bytess, &app) error " + err.Error())
|
|
fmt.Println("xml.Unmarshal(bytess, &app) error " + err.Error())
|
|
|
return controllers, err
|
|
return controllers, err
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // get sub dir name
|
|
|
|
|
+ if arr[len(arr) - 2] != "controllers"{
|
|
|
|
|
+ // if sub dir is not controllers, set the dir attr
|
|
|
|
|
+ ctrl.Dir = arr[len(arr) - 2]
|
|
|
|
|
+ }
|
|
|
controllers = append(controllers, ctrl)
|
|
controllers = append(controllers, ctrl)
|
|
|
}
|
|
}
|
|
|
return controllers, nil
|
|
return controllers, nil
|