MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / buildAppFileSystem

Function buildAppFileSystem

project/emscripten/boxedwine-shell.js:346–369  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

344 });
345 }
346 function buildAppFileSystem(callback) {
347 if(Config.appPayload.length > 0){
348 let uint8Array = getBase64Data(Config.appPayload);
349 createFile("/", Config.payloadZipFile, uint8Array);
350 callback();
351 }else if(Config.appZipFile.length > 0){
352 loadFile(Config.locateAppBaseUrl, Config.appZipFile, (uint8Array) => {
353 if (Config.Program.length > 0) {
354 let zipEntries = getZipEntries(uint8Array);
355 let folder = Config.appZipFile.toLowerCase().endsWith('.zip') ?
356 Config.appZipFile.substring(0, Config.appZipFile.length - 4) : Config.appZipFile;
357 let executablePathAndFilename = folder + "/" + Config.Program;
358 let exeFileList = zipEntries.filter(e => !e.directory && e.filename === executablePathAndFilename);
359 if (exeFileList.length == 1) {
360 Config.appSubfolder = folder;
361 }
362 }
363 createFile("/", Config.appZipFile, uint8Array);
364 callback();
365 });
366 }else{
367 callback();
368 }
369 }
370 function buildExtraFileSystems(callback) {
371 let extraFSs = [];
372 if(Config.extraPayload.length > 0){

Callers 1

initialSetupFunction · 0.85

Calls 7

getBase64DataFunction · 0.85
createFileFunction · 0.85
callbackFunction · 0.85
loadFileFunction · 0.85
getZipEntriesFunction · 0.85
endsWithMethod · 0.80
toLowerCaseMethod · 0.80

Tested by

no test coverage detected