Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
KeyboardAppBuilder.prototype.generateLayoutsJSON = function() {
// Write a dictionary list file into keyboard/js/settings/
// This file is noly used in keyboard settings page.
// (That's why we annotate latin.js too.)
var configFileDesc = utils.getFile(
this.distDir.path, 'js', 'settings', 'layouts.json');
var layouts = this.layoutConfigurator.getLayoutsJSON();
utils.writeContent(
configFileDesc, JSON.stringify(layouts, null, 2));
};
HomescreenAppBuilder.prototype.execute = function(options) {
this.setOptions(options);
var homescreen = this.customizeHomescreen();
let configFile = utils.getFile(this.stageDir.path, 'js', 'init.json');
utils.writeContent(configFile, JSON.stringify(homescreen));
if (options.VARIANT_PATH) {
svoperapps.execute(options, homescreen, this.stageDir);
}
};
VerticalHomeAppBuilder.prototype.execute = function(options) {
var homescreen = manager.getHomescreen(options);
var stageDir = utils.getFile(options.STAGE_APP_DIR);
var configFile = utils.getFile(stageDir.path, 'js', 'init.json');
utils.writeContent(configFile, JSON.stringify(homescreen));
if (options.VARIANT_PATH) {
svoperapps.execute(options, homescreen, stageDir);
}
};
BrowserAppBuilder.prototype.initJSON = function() {
var defaultJSONpath =
utils.joinPath(this.appDir.path, 'build', 'default.json');
var defaultJson = utils.getJSON(utils.getFile(defaultJSONpath));
var file =
utils.getFile(this.stageDir.path, 'js', 'init.json');
utils.writeContent(file,
utils.getDistributionFileContent('browser', defaultJson, this.distDirPath));
};
BrowserAppBuilder.prototype.initJSON = function() {
var defaultJSONpath =
utils.joinPath(this.appDir.path, 'build', 'default.json');
var defaultJson = utils.getJSON(utils.getFile(defaultJSONpath));
var file =
utils.getFile(this.stageDir.path, 'js', 'init.json');
utils.writeContent(file,
utils.getDistributionFileContent('browser', defaultJson, this.distDirPath));
};