diff options
| author | A Farzat <a@farzat.xyz> | 2026-03-06 13:08:49 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-03-07 09:26:17 +0300 |
| commit | b68015a8eb94d0590c1cfa12095bc89885209d01 (patch) | |
| tree | f9c65abc0394668aedb4b59355a5009f6127cead /utils | |
| parent | 8c1629670614f639df8a43d4730d025fe4dcdfb8 (diff) | |
| download | oreilly-epub-b68015a8eb94d0590c1cfa12095bc89885209d01.tar.gz oreilly-epub-b68015a8eb94d0590c1cfa12095bc89885209d01.zip | |
Add a util to diff epubs
This helps in debugging the effects of code changes.
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/diff-epubs.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/diff-epubs.sh b/utils/diff-epubs.sh new file mode 100755 index 0000000..80d1a79 --- /dev/null +++ b/utils/diff-epubs.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Usage: +# diff-epubs.sh path/to/old.epub path/to/new.epub + +tmp_dir="$(mktemp -d --suffix=-diff-epubs)" + +unzip "$1" -d "$tmp_dir/old" +unzip "$2" -d "$tmp_dir/new" +diff --strip-trailing-cr -r "$tmp_dir"/{old,new} +exit_status=$? +rm -rf "$tmp_dir" +exit $exit_status |
