fix: exit on errors correctly

This commit is contained in:
ptrcnull 2022-07-30 02:28:33 +02:00
parent d1ccf0e1d4
commit 00d7fdace6

11
apatch
View file

@ -2,8 +2,15 @@
startdir="$PWD"
[ -f APKBUILD ] || ( echo "please run this in a package directory"; exit 1 )
[ "$1" != "" ] || ( echo "usage: apatch <patch name>"; exit 1 )
if [ ! -f APKBUILD ]; then
error "please run this in a package directory"
exit 1
fi
if [ "$1" == "" ]; then
echo "usage: apatch <patch name>"
exit 1
fi
set -e