project-config/tools/check-channels-yaml.sh
Andreas Jaeger 6c0aacfd46 Add small message to explain check-channels-yaml.sh
Add echo to explain what this test does.

Change-Id: I7c43c287125e70b7dc89deeed22bf6a9208b4c54
2016-10-18 22:43:43 +02:00

14 lines
466 B
Bash
Executable File

#!/bin/bash
T=$(mktemp -d)
trap "rm -rf $T" EXIT
channels_file=${1:-gerritbot/channels.yaml}
# strip comments so that output can be compared meaningfully
(printf "# This file is sorted alphabetically by channel name.\n"; sed '/^[[:space:]]*#.*$/d;s/[[:space:]]*#.*$//' gerritbot/channels.yaml) > $T/comments-removed
./tools/normalize_channels_yaml.py >$T/regenned
echo "Checking whether entries are sorted alphabetically"
diff -u $T/comments-removed $T/regenned