mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-05 22:49:25 +00:00
Refactor the code to use more modular and testable approach.
This commit is contained in:
+4
-3
@@ -32,11 +32,14 @@ Visit https://github.com/lukaszraczylo/semver-generator for more information, do
|
||||
},
|
||||
}
|
||||
|
||||
// Execute executes the root command
|
||||
func Execute() {
|
||||
cobra.CheckErr(rootCmd.Execute())
|
||||
}
|
||||
|
||||
// setupCobra sets up the cobra command flags
|
||||
func (r *Setup) setupCobra() {
|
||||
var err error
|
||||
r.RepositoryName, err = rootCmd.Flags().GetString("repository")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -50,11 +53,9 @@ func (r *Setup) setupCobra() {
|
||||
panic(err)
|
||||
}
|
||||
r.UseLocal = params.varUseLocal
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// myParams holds the command line parameters
|
||||
type myParams struct {
|
||||
varRepoName string
|
||||
varRepoBranch string
|
||||
|
||||
Reference in New Issue
Block a user