Documentation
¶
Index ¶
- Variables
- func ColorCommand() *gcli.Command
- func DaemonRunCommand() *gcli.Command
- func EmojiDemoCmd() *gcli.Command
- func EnvInfoCommand() *gcli.Command
- func ExampleCommand() *gcli.Command
- func GitCommand() *gcli.Command
- func InteractDemoCommand() *gcli.Command
- func ProgressDemoCmd() *gcli.Command
- func ShowDemoCommand() *gcli.Command
- func SpinnerDemoCmd() *gcli.Command
- type GitInfoData
- type Names
Constants ¶
This section is empty.
Variables ¶
View Source
var GitPullMulti = &gcli.Command{ Name: "git:pull", UseFor: "use git pull for update multi project", Aliases: []string{"git-pull"}, Config: func(c *gcli.Command) { c.AddArg( "basePath", "the base operate dir path. default is current dir", true, ).WithValidator(func(v interface{}) (i interface{}, e error) { if !fsutil.IsDir(v.(string)) { return nil, fmt.Errorf("the base path must be an exist dir") } return v, nil }) c.AddArg( "dirNames", "the operate dir names in the base path, allow multi by spaces", false, true, ) }, Examples: ` {$fullCmd} /my/workspace project1 project2 `, Func: func(c *gcli.Command, _ []string) (err error) { var ret string basePath := c.Arg("basePath").String("./") dirNames := c.Arg("dirNames").Strings() if len(dirNames) == 0 { dirNames = getSubDirs(basePath) if len(dirNames) == 0 { return fmt.Errorf("no valid subdirs in the base path: %s", basePath) } } color.Green.Println("The operate bash path:", basePath) fmt.Println("- want updated project dir names:", dirNames) for _, name := range dirNames { ret, err = execCmd("git pull", path.Join(basePath, name)) if err != nil { return } color.Info.Println("RESULT:") fmt.Println(ret) } color.Cyan.Println("Update Complete :)") return }, }
GitPullMulti use git pull for update multi project
Functions ¶
func DaemonRunCommand ¶
func DaemonRunCommand() *gcli.Command
func EmojiDemoCmd ¶
func EmojiDemoCmd() *gcli.Command
func ProgressDemoCmd ¶
func ProgressDemoCmd() *gcli.Command
func SpinnerDemoCmd ¶
func SpinnerDemoCmd() *gcli.Command
Types ¶
type GitInfoData ¶
Click to show internal directories.
Click to hide internal directories.