commands

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfig added in v0.0.7

func FindConfig(path string) (string, error)

FindConfig will return the first .gitgroup file that it finds going up the directory tree

func Run

func Run(args []string) int

Run is the CLI entrypoint

Types

type CloneCommand

type CloneCommand struct {
	Meta
	WorkDirConfig
	ProgressBar
	MultiThread
	Progress bool
	Args     []string
}

CloneCommand implements the cli.Command interface to clone a group

func (*CloneCommand) Help

func (h *CloneCommand) Help() string

Help ...

func (*CloneCommand) Run

func (h *CloneCommand) Run(args []string) int

Run ...

func (*CloneCommand) Synopsis

func (h *CloneCommand) Synopsis() string

Synopsis ...

type Meta added in v0.0.5

type Meta struct {
	UI cli.BasicUi
}

Meta ...

func (*Meta) AskCredentials added in v0.0.5

func (m *Meta) AskCredentials() (string, string, error)

AskCredentials prompts for username and password

func (*Meta) Fatal added in v0.0.5

func (m *Meta) Fatal(v ...interface{})

Fatal outputs message in the UI and exits with exit code 1

func (*Meta) FatalError added in v0.0.5

func (m *Meta) FatalError(v error)

FatalError outputs error in the UI and exits with exit code 1, noop if error is nil

func (*Meta) Fatalf added in v0.0.5

func (m *Meta) Fatalf(format string, v ...interface{})

Fatalf outputs message in the UI and exits with exit code 1

type MultiThread added in v0.0.6

type MultiThread struct {
	// contains filtered or unexported fields
}

MultiThread ...

func (*MultiThread) FeedWorkers added in v0.0.6

func (h *MultiThread) FeedWorkers(fn func())

FeedWorkers manages input channel, closes it after "fn" finishes and closes output channel after workers finish

func (*MultiThread) FlagSet added in v0.0.6

func (h *MultiThread) FlagSet() *flag.FlagSet

FlagSet adds MultiThread specific flags

func (*MultiThread) StartWorkers added in v0.0.6

func (h *MultiThread) StartWorkers(fn func())

StartWorkers initializes the waiting group and kicks the worker goroutines

type ProgressBar added in v0.0.6

type ProgressBar struct {
	// contains filtered or unexported fields
}

ProgressBar ...

func (*ProgressBar) Start added in v0.0.6

func (p *ProgressBar) Start(count int)

Start ...

type PullCommand

type PullCommand struct {
	Meta
	WorkDirConfig
	ProgressBar
	MultiThread
	Progress bool
	WorkDir  string
	CloneNew bool
}

PullCommand implements the cli.Command interface to run git pull on every cloned project in group

func (*PullCommand) Help

func (h *PullCommand) Help() string

Help ...

func (*PullCommand) Run

func (h *PullCommand) Run(args []string) int

Run ...

func (*PullCommand) Synopsis

func (*PullCommand) Synopsis() string

Synopsis ...

type UpdateCommand

type UpdateCommand struct {
	Meta
}

UpdateCommand implements the cli.Command interface to self update git-group binary

func (*UpdateCommand) Help

func (h *UpdateCommand) Help() string

Help ...

func (*UpdateCommand) Run

func (*UpdateCommand) Run(args []string) int

Run ...

func (*UpdateCommand) Synopsis

func (*UpdateCommand) Synopsis() string

Synopsis ...

type WorkDirConfig

type WorkDirConfig struct {
	GroupURL   string
	Depth      int
	SampleSize int `json:"SampleSize,omitempty"`
	Recursive  bool
}

WorkDirConfig persists the options used to initially clone a group to re-use them for pull commands

func (*WorkDirConfig) LoadConfig added in v0.0.7

func (h *WorkDirConfig) LoadConfig(currentDir string) (string, error)

LoadConfig loads group config from the "closest" .gitgroup

func (*WorkDirConfig) SaveConfig added in v0.0.7

func (h *WorkDirConfig) SaveConfig(groupDir string) error

SaveConfig saves current group config to .gitgroup

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL