Skip to content

Commit

Permalink
Do not use GNU find features on FreeBSD (#345)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kiancross authored Sep 6, 2023
1 parent 19fb80b commit bbfb973
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions strip_symbols.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
set -e

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

0 comments on commit bbfb973

Please sign in to comment.