bin/ease-init.js
/**
 * Download and generate from a template repo.
 *
 * @param {String} template
 */
Download and generate from a template repo.
@param {String} template
Download and generate from a template repo . @param { String } template
function downloadAndGenerate (template) {
  const spinner = ora('downloading template')
  spinner.start()
  if (exists(tmp)) rm(tmp)
  download(template, tmp, { clone }, function (err) {
    spinner.stop()
    if (err) logger.fatal('Failed to download repo ' + template + ': ' + err.message.trim())
    generate(name, tmp, to, function (err) {
      if (err) logger.fatal(err)
      console.log()
      logger.success('Generated "%s".', name)
    })
  })
}
function downloadAndGenerate ( template ) { const spinner = ora ( 'downloading template' ) spinner . start ( ) if ( exists ( tmp ) ) rm ( tmp ) download ( template , tmp , { clone } , function ( err ) { spinner . stop ( ) if ( err ) logger . fatal ( 'Failed to download repo ' + template + ': ' + err . message . trim ( ) ) generate ( name , tmp , to , function ( err ) { if ( err ) logger . fatal ( err ) console . log ( ) logger . success ( 'Generated "%s".' , name ) } ) } ) }
Download and generate from a template repo.
Download and generate from a template repo .
// Remove if local template exists