Add script to sync heat template from manifest
[integration.git] / version-manifest / src / main / scripts / check-sorted.sh
1 #!/bin/bash
2
3 if [ "$#" -ne 1 ]; then
4     echo This script checks the input file to verify that it is sorted
5     echo "$0 <manifest.csv>"
6     exit 1
7 fi
8
9 LC_ALL=C sort -c $1
10 retval=$?
11 if [ $retval -ne 0 ]; then
12     echo
13     echo "[ERROR] $1 is not properly sorted.  Please sort it with the following commands:"
14     echo
15     echo "  LC_ALL=C sort < $1 > $1.tmp"
16     echo "  mv $1.tmp $1"
17     echo
18 fi
19 exit $retval