Exemple #1
0
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())
	}
}
Exemple #2
0
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)
}