Skip to content

Commit 1101d7d

Browse files
authored
Merge pull request #11 from clambin/fix-apply
2 parents 49558b0 + e99fefb commit 1101d7d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/apply.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"github.com/speakeasy-api/openapi-overlay/pkg/loader"
55
"github.com/spf13/cobra"
6+
"gopkg.in/yaml.v3"
67
"os"
78
)
89

@@ -24,7 +25,7 @@ func RunApply(cmd *cobra.Command, args []string) {
2425
}
2526

2627
var specFile string
27-
if len(args) > 0 {
28+
if len(args) > 1 {
2829
specFile = args[1]
2930
}
3031
ys, specFile, err := loader.LoadEitherSpecification(specFile, o)
@@ -37,7 +38,7 @@ func RunApply(cmd *cobra.Command, args []string) {
3738
Dief("Failed to apply overlay to spec file %q: %v", specFile, err)
3839
}
3940

40-
err = o.Format(os.Stdout)
41+
err = yaml.NewEncoder(os.Stdout).Encode(ys)
4142
if err != nil {
4243
Dief("Failed to encode spec file %q: %v", specFile, err)
4344
}

0 commit comments

Comments
 (0)