#! /usr/bin/env bash

set -euo pipefail

if ! which qrcode; then
   go install github.com/skip2/go-qrcode/qrcode@latest
fi

cd "$(dirname "$(realpath "$BASH_SOURCE")")"
cat ../../../srv/data.yaml \
| yq .routes \
| jq -r keys[] \
| grep diag \
| while read -r line; do
   f="${line##*/}.png"
   qrcode "https://25-bday-qt.home.blapointe.com/${line#/}" > "$f"
done
