aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-07-17 09:21:41 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-07-17 09:22:07 -0700
commit4d65bbf0dfac37c91214ebfb502481aa1c20c8be (patch)
treec836b2b3e1b33f5c8114ff23db79a4e9bf4990d7 /tools
parentc75faac1b517e8fb8ba5eea4c4bf7ea924f733b0 (diff)
downloadpandoc-4d65bbf0dfac37c91214ebfb502481aa1c20c8be.tar.gz
Fix diff-zip.sh so it works on Darwin.
BSD find is slightly different and doesn't have -regextype option.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/diff-zip.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/diff-zip.sh b/tools/diff-zip.sh
index fa88035f6..d32027ed6 100755
--- a/tools/diff-zip.sh
+++ b/tools/diff-zip.sh
@@ -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" || {
@@ -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