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'.
|
2024-05-30 19:19:35 +00:00
|
|
|
BAD_FILES=$(find Base/res/ -type f -perm +111)
|
2024-10-24 21:36:54 +00:00
|
|
|
BAD_FILES+=$(find Tests/ -name WPT -prune -or -perm +111 \! -type d -print | grep -Ev '\.(sh|py)$' || true)
|
2021-10-26 18:12:59 +00:00
|
|
|
else
|
2024-05-30 19:19:35 +00:00
|
|
|
BAD_FILES=$(find Base/res/ -type f -executable)
|
2024-10-24 21:36:54 +00:00
|
|
|
BAD_FILES+=$(find Tests/ -name WPT -prune -or -executable \! -type d -print | grep -Ev '\.(sh|py)$' || true)
|
2021-10-26 18:12:59 +00:00
|
|
|
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
|