summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-06-05 17:05:45 +0100
committerNick White <git@njw.name>2019-06-05 17:05:45 +0100
commitf7ecb8b610e1cc2029b588c8cdc4c073ea4faca5 (patch)
tree9f31c638da0d0f89ce4895defc391299f3b4326e
parent439a0b73e12657f1241692505770e6161f811c74 (diff)
Ensure bookgraph uses directory name even when run with . for current dir, and ensure temp dirs are destroyed
-rw-r--r--bookgraphv2.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/bookgraphv2.sh b/bookgraphv2.sh
index 9984ede..3f6cfaa 100644
--- a/bookgraphv2.sh
+++ b/bookgraphv2.sh
@@ -18,7 +18,8 @@ find "$1/best" -maxdepth 1 -type f -name '*hocr' | while read i; do
printf '%s\t%d\n' "$n" "$c" >> "$t"
done
-b=`basename "$1"`
+r=`readlink -f "$1"`
+b=`basename "$r"`
gp=`mktemp`
printf '
@@ -36,4 +37,4 @@ quit
' "$b" "$1/${b}_bookgraph.png" "$t" >> "$gp"
gnuplot "$gp"
-#rm -f "$t" "$gp"
+rm -f "$t" "$gp"