Fix chaptercount for 0-padding

This commit is contained in:
cb1 2017-10-18 17:55:19 +02:00 committed by GitHub
parent 1017f9a6e7
commit f7c4d0dce8

View File

@ -68,7 +68,7 @@ normalize_whitespace() {
}
chapter_padding() {
chaptercount=$($GREP -Pc "title\s+:\sChapter\s\d+" $metadata_file)
chaptercount=$($GREP -Pc "Chapter.*start.*end" $metadata_file)
if [[ $chaptercount -gt 9 && $chaptercount -lt 100 ]]
then
chapter=$(sed -e 's/Chapter \([[:digit:]]\)$/Chapter 0\1/' <<<$chapter)