2023-05-02 20:07:48 -04:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2023-05-04 20:01:46 -04:00
|
|
|
var debugGitCmd = &cobra.Command{
|
|
|
|
Use: "debug-git",
|
|
|
|
Short: "debug git functionality",
|
2023-05-02 20:07:48 -04:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
cfg := getConfig()
|
|
|
|
|
|
|
|
p, err := getPullPal(cmd.Context(), cfg)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("error creating new pull pal", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println("Successfully initialized pull pal")
|
|
|
|
|
2023-05-04 20:01:46 -04:00
|
|
|
err = p.DebugGit()
|
2023-05-02 20:07:48 -04:00
|
|
|
if err != nil {
|
2023-05-04 20:01:46 -04:00
|
|
|
fmt.Println("err debugging git", err)
|
2023-05-02 20:07:48 -04:00
|
|
|
return
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-05-08 20:14:19 -04:00
|
|
|
var debugGithubCmd = &cobra.Command{
|
|
|
|
Use: "debug-github",
|
|
|
|
Short: "debug github functionality",
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
cfg := getConfig()
|
|
|
|
|
|
|
|
p, err := getPullPal(cmd.Context(), cfg)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("error creating new pull pal", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println("Successfully initialized pull pal")
|
|
|
|
|
|
|
|
err = p.DebugGithub(cfg.usersToListenTo)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("err debugging github", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2023-05-02 20:07:48 -04:00
|
|
|
func init() {
|
2023-05-04 20:01:46 -04:00
|
|
|
rootCmd.AddCommand(debugGitCmd)
|
2023-05-08 20:14:19 -04:00
|
|
|
rootCmd.AddCommand(debugGithubCmd)
|
2023-05-02 20:07:48 -04:00
|
|
|
}
|