-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenPDF.sh
executable file
·37 lines (32 loc) · 1.03 KB
/
genPDF.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -euo pipefail
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
DIR="$(pwd)"
WORK="$DIR/_work/"
mkdir -p "$WORK"
genPNGs() {
cd "spdx-3-model"
git log --follow --oneline -- model.png |
while read line; do
hash="$(echo "$line"|awk '{print $1;}')"
num="$(printf "%03d\n" "$(git rev-list --count "$hash")")"
date="$(git show -s --format=%cd --date=short "$hash")"
description="$line"
>&2 echo "$hash ($num) -> $description"
outFile="$WORK/${num}-model@${hash}.png"
git show "${hash}:model.png" > "$outFile"
annotatedOutFile="$WORK/${num}-model@${hash}-annotated.png"
convert "$outFile" \
-pointsize 35 \
-background White label:"$date: $description" \
-gravity Center \
-append \
"$annotatedOutFile"
echo "$annotatedOutFile"
done |
xargs
}
genPDF() {
convert $(genPNGs) "$DIR/model.pdf"
}
genPDF