Add date to index.

This commit is contained in:
Brad Nelson
2021-12-17 21:21:53 -08:00
parent dc8361687b
commit fdf823c7af
2 changed files with 14 additions and 4 deletions

View File

@ -352,7 +352,7 @@ publish-windows: $(WINDOWS)/uEf32.exe $(WINDOWS)/uEf64.exe
$(ARCHIVE)/uEf64-$(VERSION).exe
publish-index: | $(GEN)
$(GSUTIL) ls gs://eforth/releases | tools/webindex.py >$(GEN)/archive.html
$(GSUTIL) ls -l gs://eforth/releases | tools/webindex.py >$(GEN)/archive.html
$(GSUTIL_CP) \
$(GEN)/archive.html \
gs://eforth/releases/archive.html

View File

@ -23,9 +23,19 @@ sys.stdout.write("""<!DOCTYPE html>
<h1>Release Archive</h1>
""")
output = []
for line in sys.stdin.read().splitlines():
url = line.replace('gs://eforth/', 'https://eforth.storage.googleapis.com/')
name = line.replace('gs://eforth/releases/', '')
parts = line.split()
if len(parts) != 3:
continue
modes, date, path = parts
url = path.replace('gs://eforth/', 'https://eforth.storage.googleapis.com/')
name = path.replace('gs://eforth/releases/', '')
if name == 'archive.html':
continue
sys.stdout.write('<a href="%s">%s</a><br/>\n' % (name, url))
output.append('%s <a href="%s">%s</a><br/>\n' % (date, name, url))
output.sort()
output.reverse()
for line in output:
sys.stdout.write(line)