示例#1
0
文件: build.go 项目: Joinhack/peony
func buildCommand(args []string) {
	if len(args) == 0 {
		usage(1)
	}
	importPath := args[0]
	srcRoot := peony.SearchSrcRoot(importPath)

	app := peony.NewApp(srcRoot, importPath)
	app.DevMode = true
	if err := mole.Build(app); err != nil {
		eprintf("build project error, %s\n", err.Error())
	}
}
示例#2
0
文件: run.go 项目: Joinhack/peony
func run(args []string) {
	if len(args) == 0 {
		usage(1)
	}
	importPath := args[0]
	srcRoot := peony.SearchSrcRoot(importPath)

	app := peony.NewApp(srcRoot, importPath)
	app.DevMode = true
	ag, _ := mole.NewAgent(app)
	var addr = ":8000"
	if len(args) > 1 {
		addr = args[1]
	}
	ag.Run(addr)
}