fix language scanner

master
Gordon Williams 2023-02-20 13:23:14 +00:00
parent 064eade0eb
commit 537ece3f89
1 changed files with 5 additions and 19 deletions

View File

@ -122,25 +122,11 @@ function log(s) {
console.log(s);
}
var appsFile, apps;
try {
appsFile = fs.readFileSync(BASEDIR+"apps.json").toString();
} catch (e) {
ERROR("apps.json not found");
}
if (appsFile.indexOf("---") === 0 && fs.existsSync(BASEDIR+"bin/create_apps_json.sh"))
{
console.log("apps.json has not been generated, running bin/create_apps_json.sh to build it...");
childProcess.execFileSync(BASEDIR+'bin/create_apps_json.sh',[],{
stdio: 'inherit'
var apploader = require("./lib/apploader.js");
apploader.init({
DEVICEID : "BANGLEJS2"
});
appsFile = fs.readFileSync(BASEDIR+"apps.json").toString();
}
try{
apps = JSON.parse(appsFile);
} catch (e) {
ERROR("apps.json not valid JSON");
}
var apps = apploader.apps;
// Given a string value, work out if it's obviously not a text string
function isNotString(s, wasFnCall, wasArrayAccess) {