1
0
mirror of https://github.com/beego/bee.git synced 2024-11-24 23:30:55 +00:00

rename function name for clarity

This commit is contained in:
ZhengYang 2014-08-01 18:38:32 +08:00
parent 4aa8bf8430
commit a161ff4755

View File

@ -223,7 +223,7 @@ func gen(dbms string, connStr string, mode byte, currpath string) {
mvcPath.ModelPath = path.Join(currpath, "models") mvcPath.ModelPath = path.Join(currpath, "models")
mvcPath.ControllerPath = path.Join(currpath, "controllers") mvcPath.ControllerPath = path.Join(currpath, "controllers")
mvcPath.RouterPath = path.Join(currpath, "routers") mvcPath.RouterPath = path.Join(currpath, "routers")
deleteAndRecreatePaths(mode, mvcPath) createPaths(mode, mvcPath)
writeSourceFiles(tables, mode, mvcPath) writeSourceFiles(tables, mode, mvcPath)
} }
@ -403,17 +403,14 @@ func getColumns(db *sql.DB, table *Table, blackList map[string]bool) {
} }
// deleteAndRecreatePaths removes several directories completely // deleteAndRecreatePaths removes several directories completely
func deleteAndRecreatePaths(mode byte, paths *MvcPath) { func createPaths(mode byte, paths *MvcPath) {
if (mode & O_MODEL) == O_MODEL { if (mode & O_MODEL) == O_MODEL {
//os.RemoveAll(paths.ModelPath)
os.Mkdir(paths.ModelPath, 0777) os.Mkdir(paths.ModelPath, 0777)
} }
if (mode & O_CONTROLLER) == O_CONTROLLER { if (mode & O_CONTROLLER) == O_CONTROLLER {
//os.RemoveAll(paths.ControllerPath)
os.Mkdir(paths.ControllerPath, 0777) os.Mkdir(paths.ControllerPath, 0777)
} }
if (mode & O_ROUTER) == O_ROUTER { if (mode & O_ROUTER) == O_ROUTER {
//os.RemoveAll(paths.RouterPath)
os.Mkdir(paths.RouterPath, 0777) os.Mkdir(paths.RouterPath, 0777)
} }
} }