16 lines
544 B
Bash
Executable File
16 lines
544 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
|
|
MODELS_DIR=${ROOT}/src/models
|
|
rm -rf ${MODELS_DIR}
|
|
|
|
SCHEMA_FILE=$(mktemp schema.XXX.json)
|
|
function cleanup() {
|
|
rm -rf ${SCHEMA_FILE}
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
curl https://raw.githubusercontent.com/siderolabs/talos/refs/heads/release-1.11/website/content/v1.11/schemas/config.schema.json > ${SCHEMA_FILE}
|
|
uvx --from datamodel-code-generator datamodel-codegen --input ${SCHEMA_FILE} --input-file-type jsonschema --output ${MODELS_DIR} --output-model pydantic_v2.BaseModel
|