hyperborea-character-sheet/Taskfile.yml
2022-04-26 20:20:10 -04:00

39 lines
1017 B
YAML

# https://taskfile.dev
version: "3"
tasks:
schemas:
sources: [ 'schemas-yaml/*' ]
generates: [ 'schemas-json/*' ]
cmds:
- fd -e yml -p ./schemas-yaml -x task schema SCHEMA='{}'
schema:
vars:
TRANSFORM:
sh: |
echo {{.SCHEMA}} | \
perl -lnE's/yml$/pl/; s/^/.\//; say if -f $_'
DEST:
sh: echo {{.SCHEMA}} | perl -pe's/ya?ml/json/g'
cmds:
- transerialize {{.SCHEMA}} {{.TRANSFORM}} {{.DEST}}
validate:
silent: true
cmds:
- |
ajv validate \
--all-errors \
--errors=json \
--verbose \
-c ajv-keywords \
-r schemas-json/classes.json \
-s schemas-json/character.json \
-d {{.CLI_ARGS}}
test:
deps: [ schemas ]
cmds:
- vitest run