Fix return values in script

This commit is contained in:
Guillaume Nodet
2022-04-29 17:01:18 +02:00
parent 33cdd8f75a
commit 9b4f3f9792

View File

@@ -86,7 +86,7 @@ startup_check()
fi
local unstaged
unstaged=$(echo "$uncommits" | grep -c "^ [A-Z]")
unstaged=$(echo "$uncommits" | grep -c "^ [A-Z]") || true
if [[ $unstaged -gt 0 ]]; then
echo "There are unstaged changes - cannot proceed"
echo $(echo "$uncommits" | grep "^ [A-Z]")
@@ -94,7 +94,7 @@ startup_check()
fi
local untracked
untracked=$(echo "$uncommits" | grep -c "^??");
untracked=$(echo "$uncommits" | grep -c "^??") || true
if [[ $untracked -gt 0 ]]; then
echo "There are untracked changes - cannot proceed"
echo $(echo "$uncommits" | grep "^??")