From bf770bab32065c81d99bef23acc01ae1bc8bcb9f Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Fri, 29 Mar 2024 10:34:07 -0400 Subject: [PATCH] Add more robust handling in check-dirty-tree.sh --- scripts/check-dirty-tree.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/check-dirty-tree.sh b/scripts/check-dirty-tree.sh index d1c25eb..daab442 100755 --- a/scripts/check-dirty-tree.sh +++ b/scripts/check-dirty-tree.sh @@ -13,7 +13,16 @@ fi git status | grep modified: -if [ $? = 0 ] +RESULT=$? + +if [ $RESULT = 0 ] then + # grep found something modified, reject exit 1 +elif [ $RESULT = 1 ] + # grep didn't find anything, we're ok + exit 0 +else + # Some other error + exit $RESULT fi