!/bin/sh

name="${1%%.*}"

gawk -f bb2gem.gawk < "${name}.bb" > "${name}.gmi"

printf '\n\ngardenapple - %s\n\n=> ./ Linux and low-spec-ish gaming' "$(date -I)" >> "${name}.gmi"

echo "Possibly un-handled [TAG]s:"

grep '\[' < "${name}.gmi"

~/code/go/amfora/amfora "file://$(realpath "${name}.gmi")" || amfora "file://$(realpath "${name}.gmi")"

rm -i -- "${name}.bb"