feat(commit): implement commit command parity

This commit is contained in:
Micheal Wilkinson
2026-03-20 17:48:04 +00:00
parent eeeb9f7d8e
commit d8eaf4d058
2 changed files with 32 additions and 9 deletions

View File

@@ -147,6 +147,24 @@ func (a *App) Push(castle string) error {
return runGitWithIO(filepath.Join(a.ReposDir, castle), a.Stdout, a.Stderr, "push")
}
func (a *App) Commit(castle string, message string) error {
if strings.TrimSpace(castle) == "" {
castle = "dotfiles"
}
trimmedMessage := strings.TrimSpace(message)
if trimmedMessage == "" {
return errors.New("commit requires message")
}
castledir := filepath.Join(a.ReposDir, castle)
if err := runGitWithIO(castledir, a.Stdout, a.Stderr, "add", "--all"); err != nil {
return err
}
return runGitWithIO(castledir, a.Stdout, a.Stderr, "commit", "-m", trimmedMessage)
}
func (a *App) Link(castle string) error {
if strings.TrimSpace(castle) == "" {
castle = "dotfiles"