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

changer bee

This commit is contained in:
astaxie 2013-04-11 14:49:19 +08:00
parent dac1e5ea5e
commit bd3ff53f19

View File

@ -100,7 +100,7 @@ func createapp(cmd *Command, args []string) {
fmt.Println("create views:", path.Join(apppath, "views")) fmt.Println("create views:", path.Join(apppath, "views"))
os.Mkdir(path.Join(apppath, "views"), 0755) os.Mkdir(path.Join(apppath, "views"), 0755)
fmt.Println("create conf app.conf:", path.Join(apppath, "conf", "app.conf")) fmt.Println("create conf app.conf:", path.Join(apppath, "conf", "app.conf"))
writetofile(path.Join(apppath, "conf", "app.conf"), "appname = "+args[0]) writetofile(path.Join(apppath, "conf", "app.conf"), strings.Replace(appconf, "{{.Appname}}", args[0], -1))
fmt.Println("create controllers default.go:", path.Join(apppath, "controllers", "default.go")) fmt.Println("create controllers default.go:", path.Join(apppath, "controllers", "default.go"))
writetofile(path.Join(apppath, "controllers", "default.go"), controllers) writetofile(path.Join(apppath, "controllers", "default.go"), controllers)
@ -112,6 +112,12 @@ func createapp(cmd *Command, args []string) {
writetofile(path.Join(apppath, "main.go"), strings.Replace(maingo, "{{.Appname}}", args[0], -1)) writetofile(path.Join(apppath, "main.go"), strings.Replace(maingo, "{{.Appname}}", args[0], -1))
} }
var appconf = `
appname = {{.Appname}}
httpport = 8080
runmode = dev
`
var maingo = `package main var maingo = `package main
import ( import (