Open
Description
When Const.FILES_IN_FS
is set and the following branch called
EspruinoAppLoaderCore/js/comms.js
Lines 414 to 415 in ef99424
the cmd
is appended with finalJS
which defaults to require("Storage").getStats
.
The complete resulting cmd in my use case was
USB.print("[");
let fs = require("fs");
if (!fs.statSync("APPINFO")) fs.mkdir("APPINFO");
fs.readdirSync("APPINFO").forEach((f) => {
if (!fs.statSync("APPINFO/" + f).dir) {
var j = JSON.parse(fs.readFileSync("APPINFO/" + f)) || "{}";
USB.print(
JSON.stringify({
id: f.slice(0, -5),
version: j.version,
files: j.files,
data: j.data,
type: j.type,
}) + ","
);
}
});
USB.println(
JSON.stringify(
require("Storage").getStats ? require("Storage").getStats() : {}
) +
"," +
E.toJS([
process.env.BOARD,
process.env.VERSION,
process.env.EXPTR,
process.env.MODULES,
0 | getTime(),
E.CRC32(getSerial() + (global.NRF ? NRF.getAddress() : 0)),
]).substr(1)
);
So the appList
populates as expected but the storageStats
show stats of the flash.
Metadata
Metadata
Assignees
Labels
No labels