From 8899a8271338ba19f32bae1b30e0df0392afe1bc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Aug 2011 16:37:11 +0200 Subject: Add error handling to git scripts --- git/commit.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'git/commit.sh') diff --git a/git/commit.sh b/git/commit.sh index 16a8076..cc05cf5 100755 --- a/git/commit.sh +++ b/git/commit.sh @@ -38,8 +38,20 @@ for i in $modules; do cd $i if [ "$add" = "y" ]; then git add . + + if [ $? -ne 0 ]; then + echo "add FAILED" 1>&2 + exit 1 + fi + fi git commit -F $msg_file + + if [ $? -ne 0 ]; then + echo "commit FAILED" 1>&2 + exit 1 + fi + cd $wd done -- cgit v1.1