3# This script allows you to compare two epub, odt, or docx
4# containers, ignoring insignificant formatting differences
8if [ "$UNAME" = "Darwin" ]; then
11 FIND="find -regextype posix-extended"
16test -f "$f1" -a -f "$f2" || {
17 echo "Usage: diff-zip firstfile secondfile" && exit 1
19WORKDIR=$(mktemp -d -t diff-zip.XXX)
20trap "{ rm -r $WORKDIR; }" EXIT
21unzip -q -d "$WORKDIR/a" "$f1"
22unzip -q -d "$WORKDIR/b" "$f2"
27 $FIND $x -iregex '.*\.(xhtml|xml|rdf|rels)' -exec sh -c 'mkdir -p "$(dirname tidy/$1)" && tidy -q -xml -utf8 -i "$1" > "tidy/$1"' _ {} \;
33find c -type f -exec sh -c 'echo -e "\033[1m=== ${1#*/} ===\033[0m" ; diff -u "a/${1#*/}" "b/${1#*/}" 2>&1' _ {} \;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list