implement everything stable, account switching feature

This commit is contained in:
Daveberry committed 2026-06-09 19:06:30 +08:00
1 parent 3e87fa0d53
commit f2508d0bc8
11 files changed
+292 -79

No files matched your search

+6 -15
View File
@@ -1,10 +1,7 @@
package cmd
import (
"fmt"
"os"
"os/exec"
"github.com/daveberrys/guh/src/utils"
"github.com/spf13/cobra"
)
@@ -13,16 +10,10 @@ func init() {
}
var pushCmd = &cobra.Command{
Use: "push [destination]",
Short: "Push changes to a destination",
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
dest := "main"
if len(args) > 0 { dest = args[0] }
fmt.Printf("Pushing changes to: %s...\n", dest)
out, err := exec.Command("git", "push", "origin", dest).CombinedOutput()
if err != nil { fmt.Fprintf(os.Stderr, "error: %s\n", err) }
fmt.Print(string(out))
Use: "push",
Short: "Add current changes and push",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return utils.RunGitSequence([]string{"push"})
},
}