diff --git a/appdir-lint.sh b/appdir-lint.sh old mode 100644 new mode 100755 index fac57a35..b4b01403 --- a/appdir-lint.sh +++ b/appdir-lint.sh @@ -17,10 +17,15 @@ warn () { echo "WARNING: $1" } -which desktop-file-validate >/dev/null -if [ ! $? -eq 0 ] ; then - fatal "desktop-file-validate is missing, please install it" -fi +depends () { + if ! which "$1" >/dev/null; then + fatal "$1 is missing, please install it" + fi +} + +depends desktop-file-validate +depends mimetype +depends appstreamcli if [ ! -e "${HERE}/excludelist" ] ; then fatal "excludelist missing, please install it" @@ -130,11 +135,7 @@ fi if [ -z "$APPDATA" ] ; then warn 'No appdata file present. Please provide one in the AppImage as per the instructions on https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps' else - if [ ! -z $(which appstreamcli) ] ; then - appstreamcli validate-tree "${APPDIR}" - else - echo "Skipping AppStream validation since appstreamcli is not on the \$PATH" - fi + appstreamcli validate-tree "${APPDIR}" fi