mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2024-11-03 01:38:33 -04:00
33 lines
538 B
Go
33 lines
538 B
Go
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
var runCmd = &cobra.Command{
|
||
|
Use: "run",
|
||
|
Short: "Runs a fully automated pull pal service",
|
||
|
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.Run()
|
||
|
if err != nil {
|
||
|
fmt.Println("error running", err)
|
||
|
return
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
rootCmd.AddCommand(runCmd)
|
||
|
}
|