From 03afb5b2a22ec127d13cd5cef9a30966e1fa5a50 Mon Sep 17 00:00:00 2001 From: lovelywcm Date: Sun, 18 Apr 2010 07:56:48 +0000 Subject: [PATCH] b25lIG1vcmUgZXJyb3IgaGFuZGxlcgo= --- sendGFWList.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sendGFWList.sh b/sendGFWList.sh index b05d36f..6342424 100755 --- a/sendGFWList.sh +++ b/sendGFWList.sh @@ -80,10 +80,15 @@ if [ "$convertedLog" != "" ]; then echo -e $convertedLog | git commit -a -F - && [ -s temp.patch ] && git apply temp.patch && - rm temp.patch && + rm temp.patch; - # remove (if exist) empty temp.patch - [ ! -s temp.patch -a -e temp.patch ] && rm temp.patch; + if [ -s temp.patch ]; then + echo "Error: git apply failed, your work saved at temp.patch"; + exit 1; + elif [ -a temp.patch ]; then + # empty, remove it + rm temp.patch; + fi fi if [ "$(git diff)" == "" ]; then