Skip to content

Commit

Permalink
Fixed CI find Mach-O files
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Jul 31, 2024
1 parent feb8ba7 commit 158d57a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions CIUtils/find-macho.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ fi
# Directory to search
directory=$1

# Find Mach-O and Universal Binary files in the specified directory
files=$(find "$directory" -type f -exec sh -c 'file -b "$1" | grep -q "Mach-O|universal binary" && echo "$1"' _ {} \;)

# Initialize an empty string for the output
output=""

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

# Print the formatted output
# Print the output
echo $output

0 comments on commit 158d57a

Please sign in to comment.