Skip to content

Commit 3c4b426

Browse files
committed
fx script 3.0
1 parent 601d72f commit 3c4b426

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

integration-tests/run.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ normalize_config() {
5050
' "$file" | sort
5151
;;
5252
xml)
53-
# For XML files, do not sort, just output as-is
54-
cat "$file"
53+
# For XML files, ignore order of <rule ref=.../> lines for comparison
54+
awk '
55+
BEGIN { n = 0; end = ""; }
56+
/^ *<rule ref=/ { rules[++n] = $0; next }
57+
/^ *<\/ruleset>/ { end = $0; next }
58+
{ print }
59+
END {
60+
# Sort and print rules
61+
n = asort(rules, sorted_rules)
62+
for (i = 1; i <= n; i++) print sorted_rules[i]
63+
if (end) print end
64+
}
65+
' "$file"
5566
;;
5667
*)
5768
# For other files, just sort

0 commit comments

Comments
 (0)