goc/cmd/build.go

25 lines
438 B
Go
Raw Normal View History

2021-04-04 03:42:05 +00:00
package cmd
import (
2021-04-19 02:18:37 +00:00
"github.com/qiniu/goc/v2/pkg/flag"
2021-04-04 03:42:05 +00:00
"github.com/spf13/cobra"
)
var buildCmd = &cobra.Command{
Use: "build",
2021-04-19 02:18:37 +00:00
Run: build,
DisableFlagParsing: true, // build 命令需要用原生 go 的方式处理 flags
2021-04-04 03:42:05 +00:00
}
func init() {
rootCmd.AddCommand(buildCmd)
}
2021-04-19 02:18:37 +00:00
func build(cmd *cobra.Command, args []string) {
remainedArgs := flag.BuildCmdArgsParse(cmd, args)
where, buildName := flag.GetPackagesDir(remainedArgs)
}