From 3e32acc3e46e4a9fba728196e93ad539318790c3 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Tue, 26 Oct 2021 13:12:59 -0500 Subject: [PATCH] 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. --- Meta/lint-executable-resources.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Meta/lint-executable-resources.sh b/Meta/lint-executable-resources.sh index ac63461dc59..a7069c3f10a 100755 --- a/Meta/lint-executable-resources.sh +++ b/Meta/lint-executable-resources.sh @@ -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