mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
* 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
31 lines
646 B
Go
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
|
|
},
|
|
}
|