Skip to content

Commit

Permalink
Only set the configuration from the CLI if the value is present from …
Browse files Browse the repository at this point in the history
…the CLI
  • Loading branch information
zshel committed Mar 11, 2022
1 parent 9e6165e commit dfdb4a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/releasr/releasr.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ func main() {
Action: func(c *cli.Context) error {

configuration, _ := config.Create()
configuration.Set(config.PACKAGR_SCM, c.String("scm"))
configuration.Set(config.PACKAGR_PACKAGE_TYPE, c.String("package_type"))
if c.IsSet("scm") {
configuration.Set(config.PACKAGR_SCM, c.String("scm"))
}
if c.IsSet("package_type") {
configuration.Set(config.PACKAGR_PACKAGE_TYPE, c.String("package_type"))
}

fmt.Println("package type:", configuration.GetString(config.PACKAGR_PACKAGE_TYPE))
fmt.Println("scm:", configuration.GetString(config.PACKAGR_SCM))
Expand Down

0 comments on commit dfdb4a8

Please sign in to comment.