diff --git a/update-integrity.sh b/update-integrity.sh index 7e1e0ef..0bd9e93 100755 --- a/update-integrity.sh +++ b/update-integrity.sh @@ -10,14 +10,19 @@ # check if user gave path to a PKGBUILD, # or a directory that contains it. + +# no args; check cwd if [ "$#" -eq 0 ]; then input="$PWD" +# otherwise, use arg else input="$1" fi +# if input is a dir, check for PKGBUILD if [ -d "$input" ]; then input="$input/PKGBUILD" fi +# validate; is there a PKGBUILD? if [ "$(basename "$input")" != "PKGBUILD" ] || [ ! -f "$input" ]; then echo "PKGBUILD not found!" exit 1