fix eval with minified apps

pull/14/head
Gordon Williams 2019-11-10 13:40:06 +00:00
parent 394598918b
commit 1603fe8f4b
1 changed files with 7 additions and 1 deletions

View File

@ -35,7 +35,13 @@ var AppInfo = {
storageFile.content = JSON.stringify(json);
}
// format ready for Espruino
var js = storageFile.evaluate ? storageFile.content.trim() : toJS(storageFile.content);
var js;
if (storageFile.evaluate) {
js = storageFile.content.trim();
if (js.endsWith(";"))
js = js.slice(0,-1);
} else
js = toJS(storageFile.content);
storageFile.cmd = `\x10require('Storage').write(${toJS(storageFile.name)},${js});`;
});
resolve(fileContents);