1
0
mirror of https://github.com/mfontanini/presenterm.git synced 2026-09-01 23:33:21 -06:00

chore: add script to generate config file JSON schema

This commit is contained in:
Matias Fontanini 2025-11-19 12:59:06 -08:00
parent 402b2450cc
commit d76161dee5
2 changed files with 22 additions and 1 deletions

View File

@ -83,4 +83,8 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2
- name: Validate config file schema
run: ./scripts/validate-config-file-schema.sh
run: |
if ! ./scripts/validate-config-file-schema.sh; then
echo -e "\033[31;1mRun ./scripts/generate-config-file-schema.sh to regenerate JSON schema"
exit 1
fi

View File

@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
script_dir=$(dirname "$0")
root_dir="${script_dir}/../"
current_schema=$(mktemp)
docker run \
--rm \
-v "${root_dir}:/tmp/workspace" \
-w "/tmp/workspace" \
rust:1.86 \
cargo run --features json-schema -q -- --generate-config-file-schema >"${current_schema}"
cp "$current_schema" "${root_dir}/config-file-schema.json"
rm "$current_schema"