2020-03-04 22:26:04 +01:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2020-09-21 09:27:50 +02:00
|
|
|
"git.ctrlz.es/mgdelacroix/campaigner/app"
|
2020-09-16 18:34:36 +02:00
|
|
|
|
2020-03-04 22:26:04 +01:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func SyncCmd() *cobra.Command {
|
2020-09-21 09:27:50 +02:00
|
|
|
return &cobra.Command{
|
2020-03-04 22:26:04 +01:00
|
|
|
Use: "sync",
|
2020-04-27 12:22:15 +02:00
|
|
|
Short: "Syncs the tickets",
|
|
|
|
Long: "Synchronizes the status of the published tickets with remote providers",
|
2020-03-04 22:26:04 +01:00
|
|
|
Args: cobra.NoArgs,
|
2020-09-21 09:27:50 +02:00
|
|
|
Run: withApp(syncCmdF),
|
2020-03-04 22:26:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-21 09:27:50 +02:00
|
|
|
func syncCmdF(a *app.App, cmd *cobra.Command, _ []string) {
|
|
|
|
if err := a.GithubSync(); err != nil {
|
|
|
|
ErrorAndExit(cmd, err)
|
|
|
|
}
|
|
|
|
cmd.Println("Synchronization completed")
|
2020-09-16 18:34:36 +02:00
|
|
|
}
|