Add latest.txt as per new format discussed in #7336

Remove make-latest.sh, since there's now more information than we can sensibly construct from the command line - the file should now be uploaded to releases.wagtail.io with `./latest.sh put latest.txt`.
pull/7345/head
Matt Westcott 2021-07-15 12:29:01 +01:00
rodzic 7e89180153
commit ec0daf604a
2 zmienionych plików z 10 dodań i 43 usunięć

10
scripts/latest.txt 100644
Wyświetl plik

@ -0,0 +1,10 @@
{
"version": "2.13.4",
"url": "https://docs.wagtail.io/en/stable/releases/2.13.4.html",
"majorUrl": "https://docs.wagtail.io/en/stable/releases/2.13.html",
"lts": {
"version": "2.11.8",
"url": "https://docs.wagtail.io/en/stable/releases/2.11.8.html",
"majorUrl": "https://docs.wagtail.io/en/stable/releases/2.11.html"
}
}

Wyświetl plik

@ -1,43 +0,0 @@
#! /bin/sh
# vim:sw=4 ts=4 et:
version=""
url="https://wagtail.io"
while [ ! -z "$1" ]; do
case "$1" in
--version=*)
version=$(echo "$1" | sed -e 's/^--version=//')
;;
--url=*)
url=$(echo "$1" | sed -e 's/^--url=//')
;;
*)
printf >&2 -- '%s: unknown argument "%s"\n' "$0"
printf >&2 -- 'usage: %s --version=<version> [--url=<url>]\n' "$0"
exit 1
esac
shift
done
if [ -z "$version" ]; then
printf >&2 -- '%s: must specify --version\n' "$0"
printf >&2 -- 'usage: %s --version=<version> [--url=<url>]\n' "$0"
exit 1
fi
LTMP=$(mktemp "${TMPDIR:-/tmp}/latest.XXXXXX")
if [ "$?" -ne 0 ]; then
printf >&2 -- '%s: cannot create temporary file\n' "$0"
exit 1
fi
trap 'rm -f "${LTMP}"' 0 TERM INT
cat >"${LTMP}" <<__EOF__
{
"version": "${version}",
"url": "${url}"
}
__EOF__
${0%make-latest.sh}latest.sh put "${LTMP}"