Skip to content

Commit

Permalink
feat: add info
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed Oct 17, 2024
1 parent 173c07c commit a545eed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/actions/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/foomo/squadron"
"github.com/foomo/squadron/internal/util"
"github.com/pkg/errors"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
)

Expand All @@ -23,7 +24,7 @@ func init() {

var schemaCmd = &cobra.Command{
Use: "schema [SQUADRON]",
Short: "generate squadron schemas",
Short: "generate squadron json schema",
Example: " squadron schema",
Args: cobra.MinimumNArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -44,6 +45,7 @@ var schemaCmd = &cobra.Command{
}

if flagOutput != "" {
pterm.Info.Printfln("Writing JSON schema to %s", flagOutput)
if err := os.WriteFile(flagOutput, []byte(js), 0600); err != nil {
return errors.Wrap(err, "failed to write schema")
}
Expand Down

0 comments on commit a545eed

Please sign in to comment.