summaryrefslogtreecommitdiff
path: root/bin/meta-check
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-15 13:03:50 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-15 13:03:50 -0400
commit61fc766d07e5252b9618c6548ea714649ab54a54 (patch)
tree38b7b8bd1057269ca40f2e63d570abbe3864ca02 /bin/meta-check
parent30b47ce9573dde234210ea9e0d1606ee5104b96e (diff)
Pull tool configuration into a hackers-git.yml
Diffstat (limited to 'bin/meta-check')
-rwxr-xr-xbin/meta-check9
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[@]}"