#!/bin/bash

[[ -f main.tex ]] && exit 0

reportName="$(basename "$PWD")"
replaceText="s/CHANGEME/$reportName/g"

lualatex --luaonly generate-main.lua

sed -i $replaceText README.md
desc_file=$(mktemp repo-description.XXXXXX)
$EDITOR $desc_file
cat $desc_file >> README.md
rm $desc_file
