clean up test_parser_generator.sh as per shellcheck PR feedback

This commit is contained in:
Michael Demmer 2017-10-11 06:20:56 -07:00
Родитель ef60453ee9
Коммит c878e9b949
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -9,15 +9,19 @@
CUR="sql.go"
TMP="/tmp/sql.$$.go"
cd go/vt/sqlparser/
if ! cd go/vt/sqlparser/
then
echo "ERROR: $0 must be run in the root project directory"
exit 1
fi
goyacc -o $TMP sql.y
gofmt -w $TMP
diff -q $CUR $TMP > /dev/null 2>&1
if [ $? != 0 ] ; then
echo "ERROR: Regenerated parser $TMP does not match current version `pwd`/sql.go:"
if ! diff -q $CUR $TMP > /dev/null
then
echo "ERROR: Regenerated parser $TMP does not match current version $(pwd)/sql.go:"
diff -u $CUR $TMP
exit 1
fi