Skip to content

Commit 19e5261

Browse files
fix readme check
This is needed to work around a strange behaviour in git diff-index, where a file that has a different modification time but the same content shows up as modified until git update-index --refresh is run.
1 parent 613532d commit 19e5261

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

check-if-readme-is-up-to-date.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
echo "Checking if README.md has been updated..."
44

5-
if ! git diff-index --quiet HEAD README.md; then
5+
git update-index --refresh
6+
7+
if ! git diff-index --quiet HEAD -- README.md; then
68
echo "README.md needs to be regenerated!"
79
echo
810
echo "Please run:"
911
echo " $ npm run docs"
1012
exit 1
1113
fi
14+
15+
exit 0

0 commit comments

Comments
 (0)