Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #34 from srinandan/issue33
Browse files Browse the repository at this point in the history
optionally read overrides #33
  • Loading branch information
srinandan authored Nov 1, 2022
2 parents 7d5a598 + d6bd298 commit c96b3b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/integrations/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ var CreateCmd = &cobra.Command{
return apiclient.SetProjectID(project)
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
var overridesContent []byte

if _, err := os.Stat(integrationFile); os.IsNotExist(err) {
return err
}
Expand All @@ -53,9 +55,11 @@ var CreateCmd = &cobra.Command{
return err
}

overridesContent, err := ioutil.ReadFile(overridesFile)
if err != nil {
return err
if overridesFile != "" {
overridesContent, err = ioutil.ReadFile(overridesFile)
if err != nil {
return err
}
}

_, err = integrations.CreateVersion(name, content, overridesContent, snapshot, userLabel, supressWarnings)
Expand Down

0 comments on commit c96b3b3

Please sign in to comment.