Skip to content

Commit 1046595

Browse files
committed
adding comments to script
1 parent 07c3348 commit 1046595

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/scripts/checkParser.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@
22

33
set -e
44

5-
START_DIR=$(pwd)
65
ROOT_DIR=$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")
76
cd "$ROOT_DIR" || exit 1
87

98
autocomplete_parser_backup="src/libs/SearchParser/autocompleteParser.js.bak"
109
search_parser_backup="src/libs/SearchParser/searchParser.js.bak"
1110

11+
#Copying the current .js parser files
1212
cp src/libs/SearchParser/autocompleteParser.js "$autocomplete_parser_backup" 2>/dev/null
1313
cp src/libs/SearchParser/searchParser.js "$search_parser_backup" 2>/dev/null
1414

15+
#Running the scripts that generate the .js parser files
1516
npm run generate-search-parser
1617
npm run generate-autocomplete-parser
1718

18-
19+
#Checking if the saved files differ from the newly generated
1920
if ! diff -q "$autocomplete_parser_backup" src/libs/SearchParser/autocompleteParser.js >/dev/null ||
2021
! diff -q "$search_parser_backup" src/libs/SearchParser/searchParser.js >/dev/null; then
2122
echo "The files generated from the .peggy files using the commands: generate-search-parser and generate-autocomplete-parser are not identical to those currently on this branch."
23+
echo "If it didn’t work, make sure you’ve run locally: npm run generate-search-parser and npm run generate-autocomplete-parser, and committed those changes."
2224
exit 1
2325
else
2426
echo "The files generated from the .peggy files using the commands: generate-search-parser and generate-autocomplete-parser are identical to those currently on this branch."

0 commit comments

Comments
 (0)