-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a21672
commit 4456448
Showing
1 changed file
with
9 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,28 +25,16 @@ func Execute() { | |
} | ||
|
||
func init() { | ||
var ( | ||
cfgFile string | ||
templateDir string | ||
githubOrg string | ||
committerName string | ||
committerEmail string | ||
reviewTeamName string | ||
githubToken string | ||
signCommits bool | ||
push bool | ||
) | ||
|
||
cobra.OnInitialize(initConfig) | ||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "config.yaml", "template config file (default is config.yaml)") | ||
rootCmd.PersistentFlags().StringVar(&templateDir, "templates", "templates", "Path to templates defined in the config. Defaults to ./templates") | ||
rootCmd.PersistentFlags().StringVar(&githubOrg, "github-org", "Chia-Network", "The org to process") | ||
rootCmd.PersistentFlags().StringVar(&committerName, "committer-name", "Chia Automation", "The git user to use when making commits") | ||
rootCmd.PersistentFlags().StringVar(&committerEmail, "committer-email", "[email protected]", "The git email to use when making commits") | ||
rootCmd.PersistentFlags().StringVar(&reviewTeamName, "review-team", "content-updater-reviewers", "The default team to assigned to the PRs if a repo override is not set") | ||
rootCmd.PersistentFlags().StringVar(&githubToken, "github-token", "", "The token to use to auth to GitHub API and Push to Repos") | ||
rootCmd.PersistentFlags().BoolVar(&signCommits, "sign-commits", true, "Whether or not to sign commits") | ||
rootCmd.PersistentFlags().BoolVar(&push, "push", true, "Whether or not to push and create the pull request") | ||
rootCmd.PersistentFlags().String("config", "config.yaml", "template config file (default is config.yaml)") | ||
rootCmd.PersistentFlags().String("templates", "templates", "Path to templates defined in the config. Defaults to ./templates") | ||
rootCmd.PersistentFlags().String("github-org", "Chia-Network", "The org to process") | ||
rootCmd.PersistentFlags().String("committer-name", "Chia Automation", "The git user to use when making commits") | ||
rootCmd.PersistentFlags().String("committer-email", "[email protected]", "The git email to use when making commits") | ||
rootCmd.PersistentFlags().String("review-team", "content-updater-reviewers", "The default team to assigned to the PRs if a repo override is not set") | ||
rootCmd.PersistentFlags().String("github-token", "", "The token to use to auth to GitHub API and Push to Repos") | ||
rootCmd.PersistentFlags().Bool("sign-commits", true, "Whether or not to sign commits") | ||
rootCmd.PersistentFlags().Bool("push", true, "Whether or not to push and create the pull request") | ||
|
||
cobra.CheckErr(viper.BindPFlag("config", rootCmd.PersistentFlags().Lookup("config"))) | ||
cobra.CheckErr(viper.BindPFlag("templates", rootCmd.PersistentFlags().Lookup("templates"))) | ||
|