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