Skip to content

Commit e1a3a11

Browse files
committed
Get fetchfs working without manifest support
1 parent 274ac36 commit e1a3a11

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pkg/emscripten/libretro/libretro.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ async function setupZipFS(mount) {
147147
await zipReader.close();
148148
}
149149

150-
function indexToManifest(index, manifest, path, base_url) {
150+
function loadIndex(index, path) {
151151
for (const key of Object.keys(index)) {
152152
if (index[key]) {
153-
indexToManifest(index[key], manifest, path+key+"/", base_url);
153+
Module.FS.mkdirTree(path+key+"/");
154+
loadIndex(index[key], path+key+"/");
154155
} else {
155-
manifest[path+key] = base_url + path + key;
156+
Module.FS.open(path+key, "w+");
156157
}
157158
}
158159
}
@@ -166,8 +167,8 @@ async function setupFileSystem()
166167
Module.FS.mkdir("/home/web_user/retroarch/downloads",700);
167168
let index = await (await fetch("assets/cores/.index-xhr")).json();
168169
let manifest = {};
169-
indexToManifest(index, manifest, "/", "");
170-
Module.FS.mount(Module.FETCHFS, {"manifest":manifest,"base_url":"assets/cores"}, "/home/web_user/retroarch/downloads");
170+
Module.FS.mount(Module.FETCHFS, {"base_url":"assets/cores"}, "/home/web_user/retroarch/downloads");
171+
loadIndex(index, "/home/web_user/retroarch/downloads/");
171172

172173
setupZipFS("/home/web_user/retroarch");
173174
console.log("WEBPLAYER: filesystem initialization successful");

0 commit comments

Comments
 (0)