Meta: Add special case for macOS

macOS's `find` does not support the '-executable' flag, nor does it
support the '-perm /' syntax, but we can make it work with a special
case.
This commit is contained in:
thislooksfun 2021-10-26 13:12:59 -05:00 committed by Andreas Kling
parent 170e956c80
commit 3e32acc3e4
Notes: sideshowbarker 2024-07-18 01:37:00 +09:00

View File

@ -5,7 +5,12 @@ set -eo pipefail
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "$script_path/.."
BAD_FILES=$(find Base/etc/ Base/res/ Base/www/ -type f -executable)
if [ "$(uname -s)" = "Darwin" ]; then
# MacOS's find does not support '-executable' OR '-perm /mode'.
BAD_FILES=$(find Base/etc/ Base/res/ Base/www/ -type f -perm +111)
else
BAD_FILES=$(find Base/etc/ Base/res/ Base/www/ -type f -executable)
fi
if [ -n "${BAD_FILES}" ]
then