aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAgustín Martín Barbero <agusmbaterra@gmail.com>2019-07-12 18:08:27 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2019-07-12 09:08:27 -0700
commit61346163524f9a1447604d45996e1c6e924333f1 (patch)
tree1fbc1f3af6af3ed5fd06c9b69479065385e462f2 /tools
parent83a0104d5bcfbc3eab3f9846feac2bfa6712d3c2 (diff)
downloadpandoc-61346163524f9a1447604d45996e1c6e924333f1.tar.gz
Update diff-zip to support windows (#5641)
Trying to use this script on windows (git-bash) gave several errors: - *mktemp* complained about missing XXXs in the template (fixed by adding XXX) - *find* didn't understand the -E switch (fixed by using the equivalent arguments) - *terminal codes* were not being recognized by the console (-e added to echo)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/diff-zip.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/diff-zip.sh b/tools/diff-zip.sh
index 9ac4cf621..fa88035f6 100755
--- a/tools/diff-zip.sh
+++ b/tools/diff-zip.sh
@@ -9,7 +9,7 @@ f2="$2"
test -f "$f1" -a -f "$f2" || {
echo "Usage: diff-zip firstfile secondfile" && exit 1
}
-WORKDIR=$(mktemp -d -t diff-zip)
+WORKDIR=$(mktemp -d -t diff-zip.XXX)
trap "{ rm -r $WORKDIR; }" EXIT
unzip -q -d "$WORKDIR/a" "$f1"
unzip -q -d "$WORKDIR/b" "$f2"
@@ -17,10 +17,10 @@ cd "$WORKDIR"
mkdir tidy
for x in a b; do
cp -r $x tidy/
- find -E $x -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \;
+ 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"' _ {} \;
done
cd tidy
mkdir c
cp -r a/* c/
cp -r b/* c/
-find c -type f -exec sh -c 'echo "\033[1m=== ${1#*/} ===\033[0m" ; diff -u "a/${1#*/}" "b/${1#*/}" 2>&1' _ {} \;
+find c -type f -exec sh -c 'echo -e "\033[1m=== ${1#*/} ===\033[0m" ; diff -u "a/${1#*/}" "b/${1#*/}" 2>&1' _ {} \;