mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
22 lines
506 B
Bash
22 lines
506 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
file_path=$(find "$1/Contents/MacOS" -type f -print0 | head -n 1)
|
||
|
|
||
|
if [ -z "$file_path" ]; then
|
||
|
echo "No executable file found in $1/Contents/MacOS" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|
||
|
target_architecture="$(lipo "$file_path" -archs)"
|
||
|
|
||
|
if [ -z "$target_architecture" ]; then
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# shellcheck disable=SC3045
|
||
|
find "$1" -type f -print0 | while IFS= read -r -d '' file; do
|
||
|
echo Thinning "$file" -> "$target_architecture"
|
||
|
lipo "$file" -thin "$target_architecture" -output "$file" || true
|
||
|
done
|