Fix diff-zip.sh so it works on Darwin.

BSD find is slightly different and doesn't have -regextype option.
This commit is contained in:
John MacFarlane 2019-07-17 09:21:41 -07:00
parent c75faac1b5
commit 4d65bbf0df

View file

@ -4,6 +4,13 @@
# containers, ignoring insignificant formatting differences # containers, ignoring insignificant formatting differences
# in the XML contents. # in the XML contents.
UNAME=$(uname)
if [ "$UNAME" = "Darwin" ]; then
FIND="find -E"
else
FIND="find -regextype posix-extended"
fi
f1="$1" f1="$1"
f2="$2" f2="$2"
test -f "$f1" -a -f "$f2" || { test -f "$f1" -a -f "$f2" || {
@ -17,7 +24,7 @@ cd "$WORKDIR"
mkdir tidy mkdir tidy
for x in a b; do for x in a b; do
cp -r $x tidy/ 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 done
cd tidy cd tidy
mkdir c mkdir c