2020-03-04 22:26:04 +01:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2020-09-21 08:27:50 +01:00
|
|
|
"git.ctrlz.es/mgdelacroix/campaigner/app"
|
2020-09-16 17:34:36 +01:00
|
|
|
|
2020-03-04 22:26:04 +01:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func SyncCmd() *cobra.Command {
|
2020-09-21 08:27:50 +01:00
|
|
|
return &cobra.Command{
|
2020-03-04 22:26:04 +01:00
|
|
|
Use: "sync",
|
2020-04-27 11:22:15 +01: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 08:27:50 +01:00
|
|
|
Run: withApp(syncCmdF),
|
2020-03-04 22:26:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-21 08:27:50 +01: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 17:34:36 +01:00
|
|
|
}
|