2021-04-07 20:33:38 +00:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
# Change to the generated_types crate directory, where this script is located
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
pushd $DIR
|
|
|
|
|
2021-04-08 18:16:20 +00:00
|
|
|
echo "Regenerating flatbuffers code..."
|
|
|
|
|
|
|
|
./regenerate-flatbuffers.sh
|
|
|
|
|
|
|
|
echo "Checking for uncommitted changes..."
|
|
|
|
|
2021-04-08 18:24:44 +00:00
|
|
|
if ! git diff --quiet HEAD --; then
|
2021-04-08 18:16:20 +00:00
|
|
|
echo "git diff found:"
|
|
|
|
git diff HEAD
|
|
|
|
echo "************************************************************"
|
|
|
|
echo "* Found uncommitted changes to generated flatbuffers code! *"
|
2021-07-07 13:48:30 +00:00
|
|
|
echo "* Please run \`entry/regenerate-flatbuffers.sh\` *"
|
2021-04-08 18:16:20 +00:00
|
|
|
echo "* to regenerate the flatbuffers code and check it in! *"
|
|
|
|
echo "************************************************************"
|
|
|
|
exit 1
|
2021-04-07 20:33:38 +00:00
|
|
|
else
|
2021-04-08 18:16:20 +00:00
|
|
|
echo "No uncommitted changes; this is fine."
|
2021-04-07 20:33:38 +00:00
|
|
|
fi
|