We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7b2de70 + 72ac4ec commit 774bdcbCopy full SHA for 774bdcb
run/run.go
@@ -86,10 +86,12 @@ func GetMain() *cobra.Command {
86
return err
87
}
88
89
- // add openAPI definitions from Kptfile to configured openAPI
90
- if addErr := openapi.AddSchemaFromFile(filepath.Join(args[0], kptfile.KptFileName)); addErr != nil {
91
- // do not throw error if schema doesn't exist or not readable from Kptfile
92
- return nil
+ if len(args) > 0 {
+ // add openAPI definitions from Kptfile to configured openAPI
+ if addErr := openapi.AddSchemaFromFile(filepath.Join(args[0], kptfile.KptFileName)); addErr != nil {
+ // do not throw error if schema doesn't exist or not readable from Kptfile
93
+ return nil
94
+ }
95
96
return nil
97
0 commit comments