firmware tweaks

pull/129/head
Gordon Williams 2020-03-10 15:33:41 +00:00
parent af686919a1
commit 503e370f70
2 changed files with 31 additions and 29 deletions

View File

@ -23,14 +23,16 @@ var appfiles = [];
function fileGetter(url) {
console.log("Loading "+url)
if (MINIFY) {
if (url.endsWith(".js")) {
/*if (url.endsWith(".js")) {
var f = url.slice(0,-3);
console.log("MINIFYING "+f);
const execSync = require('child_process').execSync;
code = execSync(`espruino --board BANGLEJS --minify ${f}.js -o ${f}.min.js`);
// --config PRETOKENISE=true
// --minify
code = execSync(`espruino --config SET_TIME_ON_WRITE=false --minify --board BANGLEJS ${f}.js -o ${f}.min.js`);
console.log(code.toString());
url = f+".min.js";
}
}*/
if (url.endsWith(".json")) {
var f = url.slice(0,-5);
console.log("MINIFYING JSON "+f);
@ -52,9 +54,12 @@ Promise.all(APPS.map(appid => {
});
})).then(() => {
//console.log(appfiles);
var js = "// Generated by BangleApps/bin/firmwaremaker.js\n";
var js = "// Generated by BangleApps/bin/firmwaremaker.js\nreset(1)\nvar FAIL=0;\n";
appfiles.forEach((file) => {
js += file.cmd+"\n";
/*if (file.crc && file.evaluate!==true) {
js += `\x10if (E.CRC32(require('Storage').read(${JSON.stringify(file.name)}))!=${file.crc}){console.log("${file.name} invalid");FAIL++}\n`;
}*/
});
fs.writeFileSync(OUTFILE, js);
console.log("Output written to "+OUTFILE);

File diff suppressed because one or more lines are too long