feat(pull): add --all support across cloned castles
This commit is contained in:
@@ -156,6 +156,7 @@ func (c *versionCmd) Run(app *core.App) error {
|
||||
}
|
||||
|
||||
type pullCmd struct {
|
||||
All bool `help:"Pull all castles."`
|
||||
Castle string `arg:"" optional:"" name:"CASTLE" help:"Castle name."`
|
||||
}
|
||||
|
||||
@@ -197,7 +198,15 @@ type generateCmd struct {
|
||||
Path string `arg:"" name:"PATH" help:"Path to generate a homesick-ready castle repository."`
|
||||
}
|
||||
|
||||
func (c *pullCmd) Run(app *core.App) error { return app.Pull(defaultCastle(c.Castle)) }
|
||||
func (c *pullCmd) Run(app *core.App) error {
|
||||
if c.All {
|
||||
if strings.TrimSpace(c.Castle) != "" {
|
||||
return errors.New("pull accepts either --all or CASTLE, not both")
|
||||
}
|
||||
return app.PullAll()
|
||||
}
|
||||
return app.Pull(defaultCastle(c.Castle))
|
||||
}
|
||||
func (c *pushCmd) Run(app *core.App) error { return app.Push(defaultCastle(c.Castle)) }
|
||||
func (c *commitCmd) Run(app *core.App) error {
|
||||
return app.Commit(defaultCastle(c.Castle), c.Message)
|
||||
|
||||
Reference in New Issue
Block a user