registry/check-pol

19 lines
468 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
set -o pipefail
2017-11-08 19:05:00 +01:00
if [ $# -eq 0 ]
then
echo "Usage: $0 COMMIT YOUR-MNT"
exit
fi
2017-12-31 20:03:56 +01:00
BASE="$(readlink -f "$0" 2>/dev/null || python -c 'import os,sys;print(os.path.realpath(sys.argv[1]))' "$0")"
2017-11-08 19:05:00 +01:00
BASE="$(dirname "$BASE")"
cd "$BASE" || exit 1
git diff --name-only "$1" | while IFS='/' read -ra LINE; do
if [[ "${LINE[0]}" = "data" && -n "${LINE[2]}" ]]; then
utils/schema-check/dn42-schema.py -v policy "${LINE[1]}" "${LINE[2]}" "$2"
2017-11-08 19:05:00 +01:00
fi
done