Skip to content

Commit 6c21336

Browse files
committed
allow removing files from FAT FS
1 parent 4036ae0 commit 6c21336

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/comms.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ const Comms = {
328328
console.warn("App file "+app.id+".info doesn't have a 'files' field");
329329
app.files=app.id+".info";
330330
}
331-
cmds += app.files.split(',').filter(f=>f!="").map(file => `\x10require("Storage").erase(${toJSString(file)});\n`).join("");
331+
if (Const.FILES_IN_FS)
332+
cmds += app.files.split(',').filter(f=>f!="").map(file => `\x10require("fs").unlinkSync(${toJSString(file)});\n`).join("");
333+
else
334+
cmds += app.files.split(',').filter(f=>f!="").map(file => `\x10require("Storage").erase(${toJSString(file)});\n`).join("");
332335
// remove app Data: (dataFiles and storageFiles)
333336
const data = AppInfo.parseDataString(app.data)
334337
const isGlob = f => /[?*]/.test(f)

0 commit comments

Comments
 (0)