File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,13 @@ jobs:
4848 echo " - SEARCH_FILE: $SEARCH_FILE"
4949 # --- END LOGGING ---
5050
51- # Use a chained grep to find lines containing BOTH strings, regardless of order
52- if ! grep -q -r --exclude-dir=.github --include="*.mdx" -e "$SEARCH_PRODUCT" -e "$SEARCH_FILE" . ; then
51+ # This command checks if the combination of file and product exists.
52+ if ! perl -ne 'BEGIN{undef $/;} ($found=0); if (m/<Render.*?file="file".*?product="product".*?\/>/s) {$found=1;} print "FOUND\n" if $found; ' YourFile.mdx | grep -q 'FOUND' ; then
5353 UNUSED_FILES+="$FILE\n"
5454 echo " -> UNUSED! Adding to list."
5555 else
5656 echo " -> Used. Skipping."
5757 fi
58- echo "" # Add a blank line for readability
5958 done
6059
6160 # If there are unused files, output them
You can’t perform that action at this time.
0 commit comments