From 00d7fdace685879ef03bbc3766df20dba00e4aa4 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sat, 30 Jul 2022 02:28:33 +0200 Subject: [PATCH] fix: exit on errors correctly --- apatch | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apatch b/apatch index 08e68a2..c2b9601 100755 --- a/apatch +++ b/apatch @@ -2,8 +2,15 @@ startdir="$PWD" -[ -f APKBUILD ] || ( echo "please run this in a package directory"; exit 1 ) -[ "$1" != "" ] || ( echo "usage: apatch "; exit 1 ) +if [ ! -f APKBUILD ]; then + error "please run this in a package directory" + exit 1 +fi + +if [ "$1" == "" ]; then + echo "usage: apatch " + exit 1 +fi set -e