Skip to content

Commit

Permalink
Create the directory hierarchy necessary to preload the different files.
Browse files Browse the repository at this point in the history
  • Loading branch information
qlambert-pro committed Aug 30, 2024
1 parent 56a35d0 commit fe9d1d8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/host-web/chucknode-postjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,18 @@ class ChuckNode extends AudioWorkletProcessor
{
return function()
{
// Create a directory for chugins
Module["FS_createPath"]("/", "chugins", true, true);
// Create directories required to load filesToPreload
const dirs = filesToPreload.map((f) => {
const path = f.filename.split("/");
return path.slice(0, path.length - 1);
});

dirs.forEach((dir) =>
dir.reduce((parent, name) => {
Module["FS_createPath"](parent, name, true, true);
return parent + "/" + name;
}, '/')
);

// Preload files into the file system
for( var i = 0; i < filesToPreload.length; i++ )
Expand Down

0 comments on commit fe9d1d8

Please sign in to comment.