summarylogtreecommitdiffstats
path: root/upload
diff options
context:
space:
mode:
authorBen Alex2021-08-25 09:59:56 +1000
committerBen Alex2021-08-25 09:59:56 +1000
commit170464c63fb5a5a289ce7ec967646a4212fba48d (patch)
treec4e38d96c59bd6a6cd2bb5b32eadea19320be741 /upload
parente340ad95568d1d313a57600fc526d0f680dc4f3f (diff)
downloadaur-170464c63fb5a5a289ce7ec967646a4212fba48d.tar.gz
Enhance update/upload script error detection
Diffstat (limited to 'upload')
-rwxr-xr-xupload10
1 files changed, 9 insertions, 1 deletions
diff --git a/upload b/upload
index f94e94cb7b5..dc84dee95c8 100755
--- a/upload
+++ b/upload
@@ -14,10 +14,18 @@ done
SCRIPT_HOME=`dirname "$PRG"`
$SCRIPT_HOME/update
-if [ "$?" -eq 1 ]; then
+EXIT_CODE=$?
+if [ $EXIT_CODE -eq 0 ]; then
+ echo "Package is already up to date"
+ exit 0
+elif [ $EXIT_CODE -eq 1 ]; then
+ set -e
echo "Updating Git"
cd $SCRIPT_HOME
ver="$(grep pkgver= PKGBUILD | sed 's/.*=//g')"
git commit -a -m "Update to $ver"
git push
+elif [ $EXIT_CODE -eq 2 ]; then
+ echo "update script failed with exit code 2"
+ exit 2
fi