#!/bin/bash

curl -Ss "https://git.eckner.net/Erich/$(basename "${0%/*}")/refs/" | \
  tr '<>' '\n' | \
  sed -n "
    s,^a href='/Erich/$(basename "${0%/*}")/snapshot/$(basename "${0%/*}")-\([0-9.]\+\)\.tar\.xz'$,\1,
    T
    p
  " | \
  sort -V | \
  tail -n1