Skip to content

Commit

Permalink
fix: update XML conversion logic to only process when XSL changes
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Dec 16, 2024
1 parent b2a7a51 commit 595bded
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions convert_xml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ function convert_xml_files() {
for ((i = 0; i < total_files; i += max_jobs)); do
for ((j = i; j < i + max_jobs && j < total_files; j++)); do
local xml_file="${xml_files[j]}"
if [ "$convert_all" = true ] ||
([ -f "output/.bak/$(basename $xml_file)" ] && ! cmp -s "$xml_file" "output/.bak/$(basename $xml_file)"); then
# Only convert if:
# 1. XSL changed and we detected changes in sample testing, or
# 2. Individual XML file changed (comparing with backup)
if ([ "$convert_all" = true ] && [ -n "$XSL_CHANGED" ] && [ "$changes_detected" = true ]) ||
([ -f "output/.bak/$(basename $xml_file)" ] && ! cmp -s "$xml_file" "output/.bak/$(basename $xml_file)"); then
convert_xml_to_html "$xml_file" &
((updated_count++))
fi
Expand Down

0 comments on commit 595bded

Please sign in to comment.