diff options
Diffstat (limited to 'bin/meta-check')
-rwxr-xr-x | bin/meta-check | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/meta-check b/bin/meta-check index 16994ce..4a2981e 100755 --- a/bin/meta-check +++ b/bin/meta-check @@ -2,7 +2,8 @@ . libremessages -PATH="$(dirname "$0"):$PATH" +mydir="$(dirname "$0")" +PATH="$mydir:$PATH" check-yaml() { file=$1 @@ -16,13 +17,15 @@ check-yaml() { main() { declare -i ret=0 + yamldir="$(ruby -e "load '$mydir/common.rb'; print cfg['yamldir']")" + # Check the user YAML files - for file in users/*.yml; do + for file in "$yamldir"/*.yml; do check-yaml "$file" || ret=$? done msg 'Checking for duplicate usernames' - dups=($(sed -n 's/^username: //p' -- users/*.yml| sort | uniq -d)) + dups=($(sed -n 's/^username: //p' -- "$yamldir"/*.yml| sort | uniq -d)) if (( ${#dups[@]} )); then error 'Duplicate usernames:' plain '%s' "${dups[@]}" |