mirror of
https://github.com/daveberrys/guh.git
synced 2026-11-29 00:26:46 +08:00
code cleanup, implement init repo
This commit is contained in:
1 parent
aa4f72b87d
commit
2b75245d3c
5 files changed
+21
-12
No files matched your search
+1
-3
@@ -5,9 +5,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() { rootCmd.AddCommand(diffCmd) }
|
||||||
rootCmd.AddCommand(diffCmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
var diffCmd = &cobra.Command{
|
var diffCmd = &cobra.Command{
|
||||||
Use: "diff",
|
Use: "diff",
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/daveberrys/guh/src/utils"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() { rootCmd.AddCommand(initCmd) }
|
||||||
|
|
||||||
|
var initCmd = &cobra.Command{
|
||||||
|
Use: "init",
|
||||||
|
Short: "Initialize a new repository",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
return utils.RunGitSequence(false, []string{"init"})
|
||||||
|
},
|
||||||
|
}
|
||||||
+1
-3
@@ -5,9 +5,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() { rootCmd.AddCommand(pullCmd) }
|
||||||
rootCmd.AddCommand(pullCmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
var pullCmd = &cobra.Command{
|
var pullCmd = &cobra.Command{
|
||||||
Use: "pull",
|
Use: "pull",
|
||||||
|
|||||||
+1
-3
@@ -5,9 +5,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() { rootCmd.AddCommand(pushCmd) }
|
||||||
rootCmd.AddCommand(pushCmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
var pushCmd = &cobra.Command{
|
var pushCmd = &cobra.Command{
|
||||||
Use: "push",
|
Use: "push",
|
||||||
|
|||||||
+1
-3
@@ -5,9 +5,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() { rootCmd.AddCommand(stashCmd) }
|
||||||
rootCmd.AddCommand(stashCmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
var stashCmd = &cobra.Command{
|
var stashCmd = &cobra.Command{
|
||||||
Use: "stash",
|
Use: "stash",
|
||||||
|
|||||||
Reference in new issue
Block a user