git.iko.soy/typeable/pandoc
on master help sign in
Fix diff-zip.sh so it works on Darwin.
4d65bbfJohn MacFarlane
tools/diff-zip.sh+8−1
@@ -4,6 +4,13 @@
4# containers, ignoring insignificant formatting differences
4# containers, ignoring insignificant formatting differences
5# in the XML contents.
5# in the XML contents.
6
6
7+UNAME=$(uname)
8+if [ "$UNAME" = "Darwin" ]; then
9+ FIND="find -E"
10+else
11+ FIND="find -regextype posix-extended"
12+fi
13+
7f1="$1"
14f1="$1"
8f2="$2"
15f2="$2"
9test -f "$f1" -a -f "$f2" || {
16test -f "$f1" -a -f "$f2" || {
@@ -17,7 +24,7 @@ cd "$WORKDIR"
17mkdir tidy
24mkdir tidy
18for x in a b; do
25for x in a b; do
19 cp -r $x tidy/
26 cp -r $x tidy/
20− 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"' _ {} \;
27+ $FIND $x -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \;
21done
28done
22cd tidy
29cd tidy
23mkdir c
30mkdir c