Skip to content

Commit

Permalink
Fix diff-zip.sh so it works on Darwin.
Browse files Browse the repository at this point in the history
BSD find is slightly different and doesn't have -regextype option.
  • Loading branch information
jgm committed Jul 17, 2019
1 parent c75faac commit 4d65bbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/diff-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
# containers, ignoring insignificant formatting differences
# in the XML contents.

UNAME=$(uname)
if [ "$UNAME" = "Darwin" ]; then
FIND="find -E"
else
FIND="find -regextype posix-extended"
fi

f1="$1"
f2="$2"
test -f "$f1" -a -f "$f2" || {
Expand All @@ -17,7 +24,7 @@ cd "$WORKDIR"
mkdir tidy
for x in a b; do
cp -r $x tidy/
find $x -regextype posix-extended -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \;
$FIND $x -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \;
done
cd tidy
mkdir c
Expand Down

0 comments on commit 4d65bbf

Please sign in to comment.