INNER CODE UNIT · Go
run
dropbox/dbxcli · tools/gen-json-schemas/main.go:36
func run() error {
if _, err := os.Stat("go.mod"); err != nil {
return fmt.Errorf("run from repository root: %w", err)
}
data, err := os.ReadFile(commandCatalogPath)
if err != nil {
return fmt.Errorf("read %s: %w", commandCatalogPath, err)
}
catalog, err := jsonschema.DecodeCommandCatalog(data)
if err != nil {
return fmt.Errorf("decode %s: %w", commandCatalogPath, err)
}
schema, err := jsonschema.GenerateCommandSuccessSchema(catalog)
if err != nil {
return fmt.Errorf("generate command success schema: %w", err)