Skip to content

Commit

Permalink
Merge pull request #173 from dfabulich/fix-sitegen
Browse files Browse the repository at this point in the history
Fix sitegen
  • Loading branch information
curiousdannii authored Jan 22, 2025
2 parents 8cf661b + 937bfb6 commit bcda785
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/iplayif.com/app/src/sitegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {get_metadata} from './metadata.js'

const format_terp_files: Record<string, string[]> = {
adrift4: ['scare-core.wasm', 'scare.js'],
glulx: ['quixe.js'],
glulx: ['glulxe.wasm', 'glulxe.js'],
hugo: ['hugo-core.wasm', 'hugo.js'],
tads: ['tads-core.wasm', 'tads.js'],
zcode: ['zvm.js'],
zcode: ['bocfel.wasm', 'bocfel.js'],
}

export default class SiteGenerator {
Expand Down Expand Up @@ -77,7 +77,7 @@ export default class SiteGenerator {
const paths = [
'../../index.html',
'jquery.min.js',
'main.js',
'web.js',
'waiting.gif',
'web.css',
'../fonts/iosevka/iosevka-extended.woff2',
Expand All @@ -87,7 +87,13 @@ export default class SiteGenerator {
// Get all the files
const files: Map<string, Uint8Array> = new Map()
for (const file of paths) {
files.set(path.basename(file), await fetch(`https://${this.options.cdn_domain}/dist/web/${file}`).then(r => r.arrayBuffer()).then(b => new Uint8Array(b)))
const url = `https://${this.options.cdn_domain}/dist/web/${file}`
const response = await fetch(url)
if (!response.ok) {
ctx.throw(500, `Failed ${response.status} downloading ${url}`)
}
const data = await response.arrayBuffer().then(b => new Uint8Array(b))
files.set(path.basename(file), data)
}

const options: SingleFileOptions = {
Expand Down

0 comments on commit bcda785

Please sign in to comment.