Simplify the cmd/config ext package

This commit is contained in:
Morten Torkildsen
2020-09-14 09:15:21 -07:00
parent 0770661b2a
commit cfab28a5ff
14 changed files with 42 additions and 120 deletions

View File

@@ -77,11 +77,7 @@ type TreeRunner struct {
func (r *TreeRunner) runE(c *cobra.Command, args []string) error {
var input kio.Reader
var root = "."
openAPIFileName, err := ext.OpenAPIFileName()
if err != nil {
return err
}
matchFilesGlob := append([]string{openAPIFileName}, kio.DefaultMatch...)
matchFilesGlob := append([]string{ext.KRMFileName()}, kio.DefaultMatch...)
if len(args) == 1 {
root = filepath.Clean(args[0])
input = kio.LocalPackageReader{PackagePath: args[0], MatchFilesGlob: matchFilesGlob}
@@ -163,7 +159,7 @@ func (r *TreeRunner) runE(c *cobra.Command, args []string) error {
Writer: c.OutOrStdout(),
Fields: fields,
Structure: kio.TreeStructure(r.structure),
OpenAPIFileName: openAPIFileName,
OpenAPIFileName: ext.KRMFileName(),
}},
}.Execute())
}