<commit_before>/* jshint node: true */
module.exports = {
  name: 'ember-cli-dotenv',
  config: function(environment){
    var path = require('path');
    var fs = require('fs');
    var dotenv = require('dotenv');
    var project = this.project;
    var loadedConfig;
    var config = {};
    var hasOwn = Object.prototype.hasOwnProperty;

    var configFilePath,
        dotEnvPath = this.app && this.app.options.dotEnv && this.app.options.dotEnv.path;

    if (dotEnvPath) {
      // path is defined
      if (typeof dotEnvPath === 'string') {
        configFilePath = dotEnvPath;
      } else {
        if (dotEnvPath[environment]) {
          configFilePath = dotEnvPath[environment];
        }
      }
    }

    if (!configFilePath) {
      configFilePath = path.join(project.root, '.env');
    }

    if (dotenv.config({path: configFilePath})) {
      loadedConfig = dotenv.parse(fs.readFileSync(configFilePath));
    } else {
      loadedConfig = {};
    }

    var app = this.app;
    if (!this.app) {
      return;
    }
    if (app.options.dotEnv && hasOwn.call(app.options.dotEnv, 'allow')){
      console.warn("[EMBER-CLI-DOTENV] app.options.allow has been deprecated. Please use clientAllowedKeys instead. Support will be removed in the next major version");
    }
    var allowedKeys = (app.options.dotEnv && (app.options.dotEnv.clientAllowedKeys || app.options.dotEnv.allow) || []);

    allowedKeys.forEach(function(key){
      config[key] = loadedConfig[key];
    });

    return config;
  },
  included: function(app){
    this.app = app;
  }
};<commit_msg>Don't attempt to load .env file if it doesn't exist<commit_after>/* jshint node: true */
module.exports = {
  name: 'ember-cli-dotenv',
  config: function(environment){
    var path = require('path');
    var fs = require('fs');
    var dotenv = require('dotenv');
    var project = this.project;
    var loadedConfig;
    var config = {};
    var hasOwn = Object.prototype.hasOwnProperty;

    var configFilePath,
        dotEnvPath = this.app && this.app.options.dotEnv && this.app.options.dotEnv.path;

    if (dotEnvPath) {
      // path is defined
      if (typeof dotEnvPath === 'string') {
        configFilePath = dotEnvPath;
      } else {
        if (dotEnvPath[environment]) {
          configFilePath = dotEnvPath[environment];
        }
      }
    }

    if (!configFilePath) {
      configFilePath = path.join(project.root, '.env');
    }

    if (dotenv.config({path: configFilePath}) && fs.existsSync(configFilePath)) {
      loadedConfig = dotenv.parse(fs.readFileSync(configFilePath));
    } else {
      loadedConfig = {};
    }

    var app = this.app;
    if (!this.app) {
      return;
    }
    if (app.options.dotEnv && hasOwn.call(app.options.dotEnv, 'allow')){
      console.warn("[EMBER-CLI-DOTENV] app.options.allow has been deprecated. Please use clientAllowedKeys instead. Support will be removed in the next major version");
    }
    var allowedKeys = (app.options.dotEnv && (app.options.dotEnv.clientAllowedKeys || app.options.dotEnv.allow) || []);

    allowedKeys.forEach(function(key){
      config[key] = loadedConfig[key];
    });

    return config;
  },
  included: function(app){
    this.app = app;
  }
};
{'fraction_non_alphanumeric': 0.1407751937984496, 'fraction_numerical': 0.0, 'mean_word_length': 2.7686915887850465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7329392', 'n_tokens_mistral': 996, 'n_tokens_neox': 987, 'n_words': 218}