In-browser live demo!

This commit is contained in:
2023-11-12 14:57:16 +00:00
parent ba134a8ae2
commit c49fdcdc41
24 changed files with 1191 additions and 10 deletions
+2
View File
@@ -866,6 +866,7 @@ local function download_files(manifest_data, needed_files)
table.insert(fns, function()
add_log("downloading %s", file)
local url = base_URL .. "/" .. file
write "."
local h = assert(http.get(url, nil, true))
local x = h.readAll()
h.close()
@@ -873,6 +874,7 @@ local function download_files(manifest_data, needed_files)
if (manifest_data.sizes and manifest_data.sizes[file] and manifest_data.sizes[file] ~= #x) or manifest_data.files[file] ~= hexsha then
error(("hash mismatch on %s %s (expected %s, got %s)"):format(file, url, manifest_data.files[file], hexsha)) end
fwrite(file, x)
write "."
count = count + 1
end)
end