Skip to content

Commit

Permalink
Fixed CI scripts executable file filter command
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Jul 31, 2024
1 parent 158d57a commit 0004b8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CIUtils/find-elf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
directory=$1

# Find ELF files in the specified directory
files=$(find "$directory" -type f -exec sh -c 'file -b "$1" | grep -q "ELF" && echo "$1"' _ {} \;)
files=$(find "$directory" -type f -exec sh -c 'file -b "$1" | grep -qE "ELF" && echo "$1"' _ {} \;)

# Initialize an empty string for the output
output=""
Expand Down
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 -qE "Mach-O|universal binary" && echo "$1"' _ {} \;)

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

# 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 {} +
# Loop through each file and format it
for file in $files; do
if [ -z "$output" ]; then
output="\"$file\""
else
output="$output,\"$file\""
fi
done

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

0 comments on commit 0004b8d

Please sign in to comment.