<commit_before>Promise       = require 'bluebird'
autoupdate    = require './auto-update'
loadDataFrom  = require './load-data-from'
modelNames    = require './model-names'

# update database and import data(if aDataFolder exists)
module.exports = (aApp, aOptions) ->
  aDataFolder = aOptions and aOptions.fixtures
  result = autoupdate(aApp)
  if aDataFolder
    result = result.then (models)->
      vModelNames = (aOptions and aOptions.models) || modelNames
      models = Promise.map vModelNames, (model, index)->
        loadDataFrom(aApp, model, aDataFolder)
      models
  result

<commit_msg>Propagate options through helpers in auto-update-data<commit_after>Promise       = require 'bluebird'
autoupdate    = require './auto-update'
loadDataFrom  = require './load-data-from'
modelNames    = require './model-names'

# update database and import data(if aDataFolder exists)
module.exports = (aApp, aOptions) ->
  aDataFolder = aOptions and aOptions.fixtures
  result = autoupdate(aApp, aOptions)
  if aDataFolder
    result = result.then (models)->
      vModelNames = (aOptions and aOptions.models) || modelNames
      models = Promise.map vModelNames, (model, index)->
        loadDataFrom(aApp, model, aDataFolder)
      models
  result


{'fraction_non_alphanumeric': 0.1048, 'fraction_numerical': 0.0, 'mean_word_length': 3.5824175824175826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '940510', 'n_tokens_mistral': 374, 'n_tokens_neox': 372, 'n_words': 102}