Skip to content

Commit 158d57a

Browse files
Fixed CI find Mach-O files
1 parent feb8ba7 commit 158d57a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

CIUtils/find-macho.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ fi
99
# Directory to search
1010
directory=$1
1111

12-
# Find Mach-O and Universal Binary files in the specified directory
13-
files=$(find "$directory" -type f -exec sh -c 'file -b "$1" | grep -q "Mach-O|universal binary" && echo "$1"' _ {} \;)
14-
1512
# Initialize an empty string for the output
1613
output=""
1714

18-
# Loop through each file and format it
19-
for file in $files; do
20-
if [ -z "$output" ]; then
21-
output="\"$file\""
22-
else
23-
output="$output,\"$file\""
24-
fi
25-
done
15+
# Find Mach-O and Universal Binary files in the specified directory
16+
find "$directory" -type f -exec sh -c '
17+
for file do
18+
if file "$file" | grep -qE "Mach-O|universal binary"; then
19+
if [ -n "$output" ]; then
20+
output="${output},"
21+
fi
22+
output="${output}\"$file\""
23+
fi
24+
done
25+
' sh {} +
2626

27-
# Print the formatted output
27+
# Print the output
2828
echo $output

0 commit comments

Comments
 (0)