How to use the @electron-forge/core.api.init function in @electron-forge/core

To help you get started, we’ve selected a few @electron-forge/core 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 electron-userland / electron-forge / packages / api / cli / src / electron-forge-init.ts View on Github external
.arguments('[name]')
    .option('-t, --template [name]', 'Name of the Forge template to use')
    .option('-c, --copy-ci-files', 'Whether to copy the templated CI files (defaults to false)', false)
    .option('-f, --force', 'Whether to overwrite an existing directory (defaults to false)', false)
    .action((name) => { dir = workingDir(dir, name, false); })
    .parse(process.argv);

  const initOpts: InitOptions = {
    dir,
    interactive: true,
    copyCIFiles: !!program.copyCiFiles,
    force: !!program.force,
  };
  if (program.template) initOpts.template = program.template;

  await api.init(initOpts);
})();
github adopted-ember-addons / ember-electron / blueprints / ember-electron / index.js View on Github external
async createElectronProject() {
    this.ui.writeLine(chalk.green(`Creating electron-forge project at './${electronProjectPath}'`));

    await api.init({
      dir: electronProjectPath,
      interactive: true,
      template: 'ember-electron/forge/template'
    });
  }
};