2021-01-22 16:44:05 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-12-27 14:26:43 +00:00
|
|
|
|
|
|
|
set -eo pipefail
|
2020-07-27 03:57:14 +00:00
|
|
|
|
|
|
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
|
|
cd "$script_path/.."
|
|
|
|
|
2021-10-26 18:12:59 +00:00
|
|
|
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
|
2020-07-27 03:57:14 +00:00
|
|
|
|
|
|
|
if [ -n "${BAD_FILES}" ]
|
|
|
|
then
|
|
|
|
echo "These files are marked as executable, but are in directories that do not commonly"
|
|
|
|
echo "contain executables. Please double-check the permissions of these files:"
|
|
|
|
echo "${BAD_FILES}" | xargs ls -ld
|
|
|
|
exit 1
|
|
|
|
fi
|