mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-04 08:52:55 +03:00
feat: verify dream-lock.json against jsonschema
This commit is contained in:
parent
b1e15df1a1
commit
56fae02e3a
@ -97,8 +97,8 @@
|
|||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"rootName": { "type": "string" },
|
"rootName": { "type": ["string", "null"] },
|
||||||
"rootVersion": { "type": "string" },
|
"rootVersion": { "type": ["string", "null"] },
|
||||||
"path": { "type": "string" },
|
"path": { "type": "string" },
|
||||||
"type": { "type": "string" },
|
"type": { "type": "string" },
|
||||||
"dir": { "type": "string" }
|
"dir": { "type": "string" }
|
||||||
|
@ -232,6 +232,12 @@ in
|
|||||||
| python3 ${../apps/cli/format-dream-lock.py} \
|
| python3 ${../apps/cli/format-dream-lock.py} \
|
||||||
| sponge $dreamLockPath
|
| 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
|
# add dream-lock.json to git
|
||||||
if git rev-parse --show-toplevel &>/dev/null; then
|
if git rev-parse --show-toplevel &>/dev/null; then
|
||||||
echo "adding file to git: $dreamLockPath"
|
echo "adding file to git: $dreamLockPath"
|
||||||
|
Loading…
Reference in New Issue
Block a user