aboutsummaryrefslogtreecommitdiffstats
path: root/version-manifest/src/main/scripts
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-04-06 10:56:50 -0700
committerGary Wu <gary.i.wu@huawei.com>2018-04-06 10:57:40 -0700
commitf5b6edf04f07ff98c41a0d25e5639e8844d9377c (patch)
tree21e6ee3a8b82277f34cfb24276b823b043c52423 /version-manifest/src/main/scripts
parent90470e0ad4661d2e63504bf26300eae21dde6a58 (diff)
Enforce consistent sort order across environments
Change-Id: If4b753ca344fecfaf32b3a6c498edb58c4f6a0f6 Issue-ID: INT-124 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'version-manifest/src/main/scripts')
-rwxr-xr-xversion-manifest/src/main/scripts/check-sorted.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/version-manifest/src/main/scripts/check-sorted.sh b/version-manifest/src/main/scripts/check-sorted.sh
new file mode 100755
index 000000000..d926409f4
--- /dev/null
+++ b/version-manifest/src/main/scripts/check-sorted.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+LC_ALL=C sort -c $1
+retval=$?
+if [ $retval -ne 0 ]; then
+ echo
+ echo "ERROR: $1 is not properly sorted. Please sort it with the following commands:"
+ echo
+ echo " LC_ALL=C sort < $1 > $1.tmp"
+ echo " mv $1.tmp $1"
+ echo
+fi
+exit $retval