Skip to content

Commit b1fb01b

Browse files
committed
add uncommited files checking script
1 parent 10bce3f commit b1fb01b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

check_for_uncommitted_files.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
status=$(git status --porcelain)
5+
if [ -n "$status" ]; then
6+
status="${status//'%'/'%25'}"
7+
status="${status//$'\n'/'%0A'}"
8+
status="${status//$'\r'/'%0D'}"
9+
echo "$status"
10+
exit 1
11+
else
12+
echo "The repository is clean"
13+
exit 0
14+
fi

0 commit comments

Comments
 (0)