Do not use GNU find features on FreeBSD

FreeBSD (like MacOS) does not support the `-executable` argument for
`find`. This commit checks if the OS is FreeBSD, and if so, uses the
same workaround as already in place on MacOS.
pull/345/head
Kian Cross 2 years ago
parent 19fb80bcd8
commit 60a762a791

@ -2,9 +2,9 @@
set -e set -e
DIRECTORY=${1:-/opt/wasi-sdk/bin} DIRECTORY=${1:-/opt/wasi-sdk/bin}
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then
# macos find doesnt support -executable so we fall back on having a permission # macos and freebsd find do not support -executable so we fall back on
# bit to execute: # having a permission bit to execute:
EXECUTABLES=$(find ${DIRECTORY} -type f -perm +111) EXECUTABLES=$(find ${DIRECTORY} -type f -perm +111)
else else
EXECUTABLES=$(find ${DIRECTORY} -type f -executable) EXECUTABLES=$(find ${DIRECTORY} -type f -executable)

Loading…
Cancel
Save