1
0
mirror of https://github.com/beego/bee.git synced 2025-07-05 18:20:18 +00:00

do not remove folders

This commit is contained in:
ZhengYang
2014-08-01 17:42:04 +08:00
parent 789132d622
commit 348bc3edcb
2 changed files with 38 additions and 13 deletions

14
g.go
View File

@ -52,7 +52,6 @@ func init() {
}
func generateCode(cmd *Command, args []string) {
cmd.Flag.Parse(args[1:])
curpath, _ := os.Getwd()
if len(args) < 1 {
ColorLog("[ERRO] command is missing\n")
@ -72,6 +71,19 @@ func generateCode(cmd *Command, args []string) {
case "docs":
generateDocs(curpath)
case "model":
cmd.Flag.Parse(args[1:])
if driver == "" {
driver = "mysql"
}
if conn == "" {
conn = "root:@tcp(127.0.0.1:3306)/test"
}
if level == "" {
level = "1"
}
ColorLog("[INFO] Using '%s' as 'driver'\n", driver)
ColorLog("[INFO] Using '%s' as 'conn'\n", conn)
ColorLog("[INFO] Using '%s' as 'level'\n", level)
generateModel(string(driver), string(conn), string(level), curpath)
default:
ColorLog("[ERRO] command is missing\n")