From e30ea2e601018359da5c3651ee8a3a16ea8e0ef4 Mon Sep 17 00:00:00 2001 From: Zachary Shelton Date: Fri, 11 Mar 2022 12:20:24 -0500 Subject: [PATCH] Only set the configuration from the CLI if the value is present from the CLI --- cmd/publishr/publishr.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/publishr/publishr.go b/cmd/publishr/publishr.go index d27fd5b..58ad858 100644 --- a/cmd/publishr/publishr.go +++ b/cmd/publishr/publishr.go @@ -54,9 +54,13 @@ 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")) + } if c.IsSet("local_branch") { configuration.Set(config.PACKAGR_SCM_LOCAL_BRANCH, c.String("local_branch")) } @@ -107,7 +111,7 @@ func main() { Usage: "When dry run is enabled, no data is written to file system", }, &cli.StringSliceFlag{ - Name: "upload_artifact", + Name: "upload_artifact", Usage: "Path to a release artifact(s). Can be called multiple times. Use [FILE_PATH]:[UPLOADED_FILE_NAME] syntax to override destination file name", }, },