#!/bin/sh

if [[ $# -ne 1 ]]; then
	echo expected revision as option >&2
	exit 1
fi

revision="$1"
version=$(echo $revision | grep -Po 'v[0-9.]*')
commit_date=$(git show -s --format=%ci ${revision} | cut -c1-10)

asciidoctor-pdf -a revnumber=${version} -a revdate=${commit_date} -o angelguide_en.pdf guide.adoc
asciidoctor-pdf -a revnumber=${version} -a revdate=${commit_date} -o angelguide_de.pdf -a lang=de guide.adoc
