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:
parent
402b2450cc
commit
d76161dee5
6
.github/workflows/merge.yaml
vendored
6
.github/workflows/merge.yaml
vendored
@ -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
|
||||
|
||||
17
scripts/generate-config-file-schema.sh
Executable file
17
scripts/generate-config-file-schema.sh
Executable 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"
|
||||
Loading…
x
Reference in New Issue
Block a user