UNPKG

electron-forge

Version:

A complete tool for building modern Electron applications

243 lines (242 loc) 7.62 kB
<!doctype html> <html lang="en"> <head> <title>Code coverage report for api/init.js</title> <meta charset="utf-8" /> <link rel="stylesheet" href="../prettify.css" /> <link rel="stylesheet" href="../base.css" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type='text/css'> .coverage-summary .sorter { background-image: url(../sort-arrow-sprite.png); } </style> </head> <body> <div class='wrapper'> <div class='pad1'> <h1> <a href="../index.html">All files</a> / <a href="index.html">api</a> init.js </h1> <div class='clearfix'> <div class='fl pad1y space-right2'> <span class="strong">88.24% </span> <span class="quiet">Statements</span> <span class='fraction'>15/17</span> </div> <div class='fl pad1y space-right2'> <span class="strong">84.62% </span> <span class="quiet">Branches</span> <span class='fraction'>11/13</span> </div> <div class='fl pad1y space-right2'> <span class="strong">100% </span> <span class="quiet">Functions</span> <span class='fraction'>1/1</span> </div> <div class='fl pad1y space-right2'> <span class="strong">88.24% </span> <span class="quiet">Lines</span> <span class='fraction'>15/17</span> </div> </div> </div> <div class='status-line high'></div> <pre><table class="coverage"> <tr><td class="line-count quiet">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-yes">3x</span> <span class="cline-any cline-yes">3x</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-yes">6x</span> <span class="cline-any cline-yes">3x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">3x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import debug from 'debug'; &nbsp; import initCustom from '../init/init-custom'; import initDirectory from '../init/init-directory'; import initGit from '../init/init-git'; import initNPM from '../init/init-npm'; import initStandardFix from '../init/init-standard-fix'; import initStarter from '../init/init-starter-files'; &nbsp; import asyncOra from '../util/ora-handler'; &nbsp; const d = debug('electron-forge:init'); &nbsp; /** * @typedef {Object} InitOptions * @property {string} [dir=process.cwd()] The path to the app to be initialized * @property {boolean} [interactive=false] Whether to use sensible defaults or prompt the user visually * @property {string} [lintstyle=airbnb] The lintstyle to pass through to the template creator * @property {string} [template] The custom template to use. If left empty, the default template is used */ &nbsp; /** * Initialize a new Electron Forge template project in the given directory. * * @param {InitOptions} providedOptions - Options for the init method * @return {Promise} Will resolve when the initialization process is complete */ export default async (providedOptions = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> =&gt; { // eslint-disable-next-line prefer-const, no-unused-vars let { dir, interactive, lintstyle, template } = Object.assign({ dir: process.cwd(), interactive: false, lintstyle: 'airbnb', template: null, }, providedOptions); asyncOra.interactive = interactive; &nbsp; d(`Initializing in: ${dir}`); &nbsp; if (!template) { lintstyle = lintstyle.toLowerCase(); <span class="missing-if-branch" title="if path not taken" >I</span>if (!['airbnb', 'standard'].includes(lintstyle)) { <span class="cstat-no" title="statement not covered" > d(`Unrecognized lintstyle argument: '${lintstyle}' -- defaulting to 'airbnb'`);</span> <span class="cstat-no" title="statement not covered" > lintstyle = 'airbnb';</span> } } &nbsp; await initDirectory(dir, interactive); await initGit(dir); await initStarter(dir, template ? undefined : lintstyle); await initNPM(dir, template ? undefined : lintstyle); if (!template) { if (lintstyle === 'standard') { await initStandardFix(dir); } } else { await initCustom(dir, template, lintstyle); } }; &nbsp;</pre></td></tr> </table></pre> <div class='push'></div><!-- for sticky footer --> </div><!-- /wrapper --> <div class='footer quiet pad2 space-top1 center small'> Code coverage generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 15 2017 17:22:43 GMT+1100 (AEDT) </div> </div> <script src="../prettify.js"></script> <script> window.onload = function () { if (typeof prettyPrint === 'function') { prettyPrint(); } }; </script> <script src="../sorter.js"></script> </body> </html>