2021-01-22 19:44:05 +03:00
|
|
|
#!/usr/bin/env bash
|
2020-12-27 17:26:43 +03:00
|
|
|
|
|
|
|
set -eo pipefail
|
2020-07-27 06:57:14 +03:00
|
|
|
|
|
|
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
|
|
cd "$script_path/.."
|
|
|
|
|
2021-10-26 21:12:59 +03: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 06:57:14 +03: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
|