feat(pull): implement pull command parity
This commit is contained in:
@@ -155,7 +155,9 @@ func (c *versionCmd) Run(app *core.App) error {
|
||||
return app.Version(version.String)
|
||||
}
|
||||
|
||||
type pullCmd struct{}
|
||||
type pullCmd struct {
|
||||
Castle string `arg:"" optional:"" name:"CASTLE" help:"Castle name."`
|
||||
}
|
||||
|
||||
type pushCmd struct{}
|
||||
|
||||
@@ -177,7 +179,7 @@ type rcCmd struct {
|
||||
|
||||
type generateCmd struct{}
|
||||
|
||||
func (c *pullCmd) Run() error { return notImplemented("pull") }
|
||||
func (c *pullCmd) Run(app *core.App) error { return app.Pull(defaultCastle(c.Castle)) }
|
||||
func (c *pushCmd) Run() error { return notImplemented("push") }
|
||||
func (c *commitCmd) Run() error { return notImplemented("commit") }
|
||||
func (c *destroyCmd) Run() error { return notImplemented("destroy") }
|
||||
|
||||
@@ -133,6 +133,13 @@ func (a *App) Diff(castle string) error {
|
||||
return runGitWithIO(filepath.Join(a.ReposDir, castle), a.Stdout, a.Stderr, "diff")
|
||||
}
|
||||
|
||||
func (a *App) Pull(castle string) error {
|
||||
if strings.TrimSpace(castle) == "" {
|
||||
castle = "dotfiles"
|
||||
}
|
||||
return runGitWithIO(filepath.Join(a.ReposDir, castle), a.Stdout, a.Stderr, "pull")
|
||||
}
|
||||
|
||||
func (a *App) Link(castle string) error {
|
||||
if strings.TrimSpace(castle) == "" {
|
||||
castle = "dotfiles"
|
||||
|
||||
Reference in New Issue
Block a user