Skip to content

Commit

Permalink
Merge pull request #231 from GoogleCloudPlatform/issue230
Browse files Browse the repository at this point in the history
bug: handles empty configvars #230
  • Loading branch information
srinandan authored Apr 15, 2024
2 parents fa8fdfa + 5270df9 commit 8d9fcd7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions internal/cmd/integrations/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ var PublishVerCmd = &cobra.Command{
version := cmd.Flag("ver").Value.String()
name := cmd.Flag("name").Value.String()
configVarsFile := cmd.Flag("config-vars").Value.String()
var contents []byte

if _, err := os.Stat(configVarsFile); os.IsNotExist(err) {
return err
}
if configVarsFile != "" {
if _, err := os.Stat(configVarsFile); os.IsNotExist(err) {
return err
}

contents, err := os.ReadFile(configVarsFile)
if err != nil {
return err
contents, err = os.ReadFile(configVarsFile)
if err != nil {
return err
}
}

if version != "" {
Expand Down

0 comments on commit 8d9fcd7

Please sign in to comment.