message: Extract text replacement calls
diff: @@ -243,15 +243,7 @@ exports.start = function (readyCallback) {
  }
  function populateIndexTemplate () {
  - fs.copy('app/index.template.html', 'app/index.html', { overwrite: true }, () => {
  - if (config.get('application.logo')) {
  - let logo = config.get('application.logo')
  - if (utils.startsWith(logo, 'http')) {
  - const logoPath = logo
  - logo = decodeURIComponent(logo.substring(logo.lastIndexOf('/') + 1))
  - utils.downloadToFile(logoPath, 'app/public/images/' + logo)
  - }
  - const logoImageTag = '<img class="navbar-brand navbar-logo" src="/public/images/' + logo + '">'
  + function replaceLogo (logoImageTag) {
  replace({
  regex: /<img class="navbar-brand navbar-logo"(.*?)>/,
  replacement: logoImageTag,
  @@ -260,7 +252,8 @@ exports.start = function (readyCallback) {
  silent: true
  })
  }
  - if (config.get('application.theme')) {
  +
  + function replaceTheme () {
  const themeCss = 'bower_components/bootswatch/' + config.get('application.theme') + '/bootstrap.min.css'
  replace({
  regex: /bower_components\/bootswatch\/.*\/bootstrap\.min\.css/,
  @@ -270,6 +263,21 @@ exports.start = function (readyCallback) {
  silent: true
  })
  }
  +
  + fs.copy('app/index.template.html', 'app/index.html', { overwrite: true }, () => {
  + if (config.get('application.logo')) {
  + let logo = config.get('application.logo')
  + if (utils.startsWith(logo, 'http')) {
  + const logoPath = logo
  + logo = decodeURIComponent(logo.substring(logo.lastIndexOf('/') + 1))
  + utils.downloadToFile(logoPath, 'app/public/images/' + logo)
  + }
  + const logoImageTag = '<img class="navbar-brand navbar-logo" src="/public/images/' + logo + '">'
  + replaceLogo(logoImageTag)
  + }
  + if (config.get('application.theme')) {
  + replaceTheme()
  + }
  })
  }
  