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

return actual value from subcommand

This commit is contained in:
葛琦
2014-08-15 17:38:51 +08:00
parent 70886d4cfd
commit 55741df579
12 changed files with 24 additions and 14 deletions

3
new.go
View File

@ -55,7 +55,7 @@ func init() {
cmdNew.Run = createApp
}
func createApp(cmd *Command, args []string) {
func createApp(cmd *Command, args []string) int {
curpath, _ := os.Getwd()
if len(args) != 1 {
ColorLog("[ERRO] Argument [appname] is missing\n")
@ -139,6 +139,7 @@ func createApp(cmd *Command, args []string) {
writetofile(path.Join(apppath, "main.go"), strings.Replace(maingo, "{{.Appname}}", strings.Join(strings.Split(apppath[len(appsrcpath)+1:], string(path.Separator)), "/"), -1))
ColorLog("[SUCC] New application successfully created!\n")
return 0
}
var appconf = `appname = {{.Appname}}