Skip to content

Commit

Permalink
Add / to buildPath if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarpinian committed May 3, 2024
1 parent 6ca30d1 commit aa8f681
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/web/ioquake3.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
for (const file of files) assetResponses.push(fetch(`${pakPathname}/${file}`).then(r => r.ok ? r.arrayBuffer() : null));

// If buildPath is not specified, try to find a build in one of a few default paths.
const buildPath = urlParams.get('buildPath');
let buildPath = urlParams.get('buildPath');
if (buildPath && !buildPath.endsWith('/')) buildPath += '/';
const buildPaths = buildPath ? [buildPath] : ['../../build/debug-emscripten-wasm32/', '../../build/release-emscripten-wasm32/', './'];
const scriptPaths = buildPaths.map(buildPath => buildPath + 'ioquake3.wasm32.js');
const scriptResponses = await Promise.all(scriptPaths.map(p => fetch(p, {method: 'HEAD'})));
Expand Down

0 comments on commit aa8f681

Please sign in to comment.