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

@@ -96,16 +96,11 @@ func (r *FmtRunner) runE(c *cobra.Command, args []string) error {
}
func (r *FmtRunner) executeCmd(w io.Writer, pkgPath string) error {
openAPIFileName, err := ext.OpenAPIFileName()
if err != nil {
return err
}
rw := &kio.LocalPackageReadWriter{
NoDeleteFiles: true,
PackagePath: pkgPath,
KeepReaderAnnotations: r.KeepAnnotations, PackageFileName: openAPIFileName}
err = kio.Pipeline{
KeepReaderAnnotations: r.KeepAnnotations, PackageFileName: ext.KRMFileName()}
err := kio.Pipeline{
Inputs: []kio.Reader{rw}, Filters: r.fmtFilters(), Outputs: []kio.Writer{rw}}.Execute()
if err != nil {