mirror of
https://github.com/beego/bee.git
synced 2025-06-20 08:20:39 +00:00
fmt code, and fix bug(bee new has wrong path seprator in windows)
This commit is contained in:
2
new.go
2
new.go
@ -108,7 +108,7 @@ func createApp(cmd *Command, args []string) {
|
|||||||
writetofile(path.Join(apppath, "views", "index.tpl"), indextpl)
|
writetofile(path.Join(apppath, "views", "index.tpl"), indextpl)
|
||||||
|
|
||||||
fmt.Println(path.Join(apppath, "main.go"))
|
fmt.Println(path.Join(apppath, "main.go"))
|
||||||
writetofile(path.Join(apppath, "main.go"), strings.Replace(maingo, "{{.Appname}}", strings.Join(strings.Split(apppath[len(appsrcpath)+1:], string(path.Separator)), string(path.Separator)), -1))
|
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")
|
colorLog("[SUCC] New application successfully created!\n")
|
||||||
}
|
}
|
||||||
|
8
test.go
8
test.go
@ -1,11 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
path "path/filepath"
|
|
||||||
"os/exec"
|
|
||||||
"time"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
path "path/filepath"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cmdTest = &Command{
|
var cmdTest = &Command{
|
||||||
|
Reference in New Issue
Block a user