feat: verify dream-lock.json against jsonschema

This commit is contained in:
DavHau 2022-07-29 21:59:20 +02:00
parent b1e15df1a1
commit 56fae02e3a
2 changed files with 8 additions and 2 deletions

View File

@ -97,8 +97,8 @@
},
"then": {
"properties": {
"rootName": { "type": "string" },
"rootVersion": { "type": "string" },
"rootName": { "type": ["string", "null"] },
"rootVersion": { "type": ["string", "null"] },
"path": { "type": "string" },
"type": { "type": "string" },
"dir": { "type": "string" }

View File

@ -232,6 +232,12 @@ in
| python3 ${../apps/cli/format-dream-lock.py} \
| sponge $dreamLockPath
# validate dream-lock.json against jsonschema
${python3.pkgs.jsonschema}/bin/jsonschema \
--instance $dreamLockPath \
--output pretty \
${../specifications/dream-lock-schema.json}
# add dream-lock.json to git
if git rev-parse --show-toplevel &>/dev/null; then
echo "adding file to git: $dreamLockPath"