databricks-cli/cmd/bundle/validate.go

29 lines
490 B
Go

package bundle
import (
"encoding/json"
"github.com/databricks/bricks/bundle"
"github.com/spf13/cobra"
)
var validate = &cobra.Command{
Use: "validate",
Short: "Validate configuration",
PreRunE: ConfigureBundle,
RunE: func(cmd *cobra.Command, args []string) error {
b := bundle.Get(cmd.Context())
buf, err := json.MarshalIndent(b.Config, "", " ")
if err != nil {
return err
}
cmd.OutOrStdout().Write(buf)
return nil
},
}
func init() {
AddCommand(validate)
}