Skip to content

Commit

Permalink
allow removing files from FAT FS
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Dec 5, 2024
1 parent 4036ae0 commit 6c21336
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/comms.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,10 @@ const Comms = {
console.warn("App file "+app.id+".info doesn't have a 'files' field");
app.files=app.id+".info";
}
cmds += app.files.split(',').filter(f=>f!="").map(file => `\x10require("Storage").erase(${toJSString(file)});\n`).join("");
if (Const.FILES_IN_FS)
cmds += app.files.split(',').filter(f=>f!="").map(file => `\x10require("fs").unlinkSync(${toJSString(file)});\n`).join("");
else
cmds += app.files.split(',').filter(f=>f!="").map(file => `\x10require("Storage").erase(${toJSString(file)});\n`).join("");
// remove app Data: (dataFiles and storageFiles)
const data = AppInfo.parseDataString(app.data)
const isGlob = f => /[?*]/.test(f)
Expand Down

0 comments on commit 6c21336

Please sign in to comment.