Files
pack/cli/schema.go
T
Michael BiancoandGitHub 13ad6257d4 build: upgrade go version (#515)
* build: update go version

* build: lockfile upgrades

* refactor: use switch statements for conditionals

* style: fix blank identifier assignments as receivers

* fix: ignore deferred io and removal errors

* refactor: general code improvements and staticcheck fixes

* test: bump golangci-lint-action version

* build: add go package upgrade task

* build: go package bump

* build: add go mod check to mise check task

* build: upgrade go packages automatically when upgrading mise

* build: update go version in local frontend image
2026-03-16 20:26:16 -06:00

31 lines
646 B
Go

package cli
import (
"context"
"encoding/json"
"os"
"github.com/railwayapp/railpack/core/config"
"github.com/urfave/cli/v3"
)
var SchemaCommand = &cli.Command{
Name: "schema",
Usage: "outputs the JSON schema for the Railpack config",
EnableShellCompletion: true,
Flags: []cli.Flag{},
Action: func(ctx context.Context, cmd *cli.Command) error {
schema := config.GetJsonSchema()
schemaJson, err := json.MarshalIndent(schema, "", " ")
if err != nil {
return cli.Exit(err, 1)
}
_, _ = os.Stdout.Write(schemaJson)
_, _ = os.Stdout.Write([]byte("\n"))
return nil
},
}