build.js
function downloadBootstrapAssets(version, path) {
  console.log(chalk.blue((`Downloading Bootstrap assets to ${path}`)))
  version = semver.clean(version)
  const url = 'https://maxcdn.bootstrapcdn.com/bootstrap'
  var proms = [
    'fonts/glyphicons-halflings-regular.eot',
    'fonts/glyphicons-halflings-regular.woff',
    'fonts/glyphicons-halflings-regular.woff2',
    'fonts/glyphicons-halflings-regular.ttf',
    'fonts/glyphicons-halflings-regular.svg'
  ].map(f => {
    return download(`${url}/${version}/${f}`, `${path}/fonts`)
      .catch(e => {
        console.log(chalk.red(`Downloading ${version}/${f} failed.`))
        return Promise.resolve()
      })
  })

  proms = proms.concat([
      'js/bootstrap.js',
      'js/bootstrap.min.js'
    ].map(f => {
      return download(`${url}/${version}/${f}`, `${path}/js`)
        .catch(e => {
          console.log(chalk.red(`Downloading ${version}/${f} failed.`))
          return Promise.resolve()
        })
    })
  )
  return Promise.all(proms)
}
function downloadBootstrapAssets(version, path) {
  console.log(chalk.blue((`Downloading Bootstrap assets to ${path}`)))
  version = semver.clean(version)
  const url = 'https://maxcdn.bootstrapcdn.com/bootstrap'
  var proms = [
    'fonts/glyphicons-halflings-regular.eot',
    'fonts/glyphicons-halflings-regular.woff',
    'fonts/glyphicons-halflings-regular.woff2',
    'fonts/glyphicons-halflings-regular.ttf',
    'fonts/glyphicons-halflings-regular.svg'
  ].map(f => {
    return download(`${url}/${version}/${f}`, `${path}/fonts`)
      .catch(e => {
        console.log(chalk.red(`Downloading ${version}/${f} failed.`))
        return Promise.resolve()
      })
  })

  proms = proms.concat([
      'js/bootstrap.js',
      'js/bootstrap.min.js'
    ].map(f => {
      return download(`${url}/${version}/${f}`, `${path}/js`)
        .catch(e => {
          console.log(chalk.red(`Downloading ${version}/${f} failed.`))
          return Promise.resolve()
        })
    })
  )
  return Promise.all(proms)
}
function downloadBootstrapAssets ( version , path ) { console . log ( chalk . blue ( ( ` ${ path } ` ) ) ) version = semver . clean ( version ) const url = 'https://maxcdn.bootstrapcdn.com/bootstrap' var proms = [ 'fonts/glyphicons-halflings-regular.eot' , 'fonts/glyphicons-halflings-regular.woff' , 'fonts/glyphicons-halflings-regular.woff2' , 'fonts/glyphicons-halflings-regular.ttf' , 'fonts/glyphicons-halflings-regular.svg' ] . map ( f => { return download ( ` ${ url } ${ version } ${ f } ` , ` ${ path } ` ) . catch ( e => { console . log ( chalk . red ( ` ${ version } ${ f } ` ) ) return Promise . resolve ( ) } ) } ) proms = proms . concat ( [ 'js/bootstrap.js' , 'js/bootstrap.min.js' ] . map ( f => { return download ( ` ${ url } ${ version } ${ f } ` , ` ${ path } ` ) . catch ( e => { console . log ( chalk . red ( ` ${ version } ${ f } ` ) ) return Promise . resolve ( ) } ) } ) ) return Promise . all ( proms ) }
Downloads bootstrap js and font files by given version to destination path.
@param  {String} version Semver
@param  {String} path    Save destination
@return {Promise}
Downloads bootstrap js and font files by given version to destination path .