Serenity Operating System
1#!/usr/bin/env bash
2
3set -eo pipefail
4
5script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
6cd "$script_path/.."
7
8if [ "$(uname -s)" = "Darwin" ]; then
9 # MacOS's find does not support '-executable' OR '-perm /mode'.
10 BAD_FILES=$(find Base/etc/ Base/res/ Base/www/ -type f -perm +111)
11else
12 BAD_FILES=$(find Base/etc/ Base/res/ Base/www/ -type f -executable)
13fi
14
15if [ -n "${BAD_FILES}" ]
16then
17 echo "These files are marked as executable, but are in directories that do not commonly"
18 echo "contain executables. Please double-check the permissions of these files:"
19 echo "${BAD_FILES}" | xargs ls -ld
20 exit 1
21fi