aboutsummaryrefslogtreecommitdiff
path: root/bin/compile-book
diff options
context:
space:
mode:
Diffstat (limited to 'bin/compile-book')
-rwxr-xr-xbin/compile-book12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/compile-book b/bin/compile-book
index e68a36d..a068fe7 100755
--- a/bin/compile-book
+++ b/bin/compile-book
@@ -12,6 +12,8 @@ OUTPUT="${1:-book}"
REVISION="$2"
DATE="$3"
LANG="`grep lang _common.yml _book.yml _notes.yml 2> /dev/null | tail -1 | cut -d : -f 3 | sed -e 's/"//g' -e 's/ //g'`"
+METADATA=".metadata"
+LATEST="$METADATA/latest.txt"
# Set the language
if [ -z "$LANG" ]; then
@@ -32,6 +34,9 @@ rm -f $OUTPUT.md $OUTPUT.Rmd
cat _book.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
cat _common.yml >> $OUTPUT.md ; echo "" >> $OUTPUT.md
+# Build changelog
+$DIRNAME/compile-changelog
+
# Bibliography
$BASEDIR/bin/biblio-yml > _biblio.yml
cat _biblio.yml >> $OUTPUT.md
@@ -74,3 +79,10 @@ fi
# Symlink as a Bookdown source
ln -sf $OUTPUT.md $OUTPUT.Rmd
+
+# Check if the revision is a tag
+if git tag | grep -q "^${REVISION}$"; then
+ # Save info on the latest tagged release
+ mkdir -p $METADATA
+ echo $REVISION > $LATEST
+fi