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); console.log(s);
} }
var appsFile, apps; var apploader = require("./lib/apploader.js");
try { apploader.init({
appsFile = fs.readFileSync(BASEDIR+"apps.json").toString(); DEVICEID : "BANGLEJS2"
} catch (e) { });
ERROR("apps.json not found"); var apps = apploader.apps;
}
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'
});
appsFile = fs.readFileSync(BASEDIR+"apps.json").toString();
}
try{
apps = JSON.parse(appsFile);
} catch (e) {
ERROR("apps.json not valid JSON");
}
// Given a string value, work out if it's obviously not a text string // Given a string value, work out if it's obviously not a text string
function isNotString(s, wasFnCall, wasArrayAccess) { function isNotString(s, wasFnCall, wasArrayAccess) {