How to use the utils.getFile function in utils

To help you get started, we’ve selected a few utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla-b2g / gaia / apps / keyboard / build / build.js View on Github external
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));
};
github mozilla-b2g / gaia / apps / homescreen / build / build.js View on Github external
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);
  }
};
github mozilla-b2g / gaia / apps / verticalhome / build / build.js View on Github external
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);
  }
};
github mozilla-b2g / gaia / tv_apps / browser / build / build.js View on Github external
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));
};
github mozilla-b2g / gaia / apps / browser / build / build.js View on Github external
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));
};

utils

Fast, generic JavaScript/node.js utility functions.

MIT
Latest version published 9 years ago

Package Health Score

44 / 100
Full package analysis