<commit_before>var habitat = require('habitat');
var path = require('path');
var fs = require('fs');

var defaultPath = path.join(__dirname, '../config/defaults.env');
var prodPath = path.join(__dirname, '../config/production.env');

function fileErrors() {
  process.stderr.write(
    'Looks like there is a problem with your config paths.\n' +
    'See npm_tasks/build-config.js\n'
  );
  process.exit(1);
}

// Check paths to make sure they exist
try {
  if (!fs.statSync(defaultPath).isFile() || !fs.statSync(defaultPath)) {
    fileErrors();
  }
} catch (e) {
  fileErrors();
}

// Local environment in .env overwrites everything else
habitat.load('.env');

var environment = habitat.get('NODE_ENV', '').toLowerCase();


if (environment === 'production') {
  habitat.load(prodPath);
}

habitat.load(defaultPath);

var config = {
  CLIENT_ID: habitat.get('CLIENT_ID'),
  API_URI: habitat.get('API_URI'),
  LOGIN_URI: habitat.get('LOGIN_URI')
};

process.stdout.write(
  '// THIS IS A GENERATED FILE. EDIT npm_tasks/build-config.js INSTEAD\n' +
  'module.exports = ' + JSON.stringify(config) + ';\n'
);
<commit_msg>more detail for error message<commit_after>var habitat = require('habitat');
var path = require('path');
var fs = require('fs');

var defaultPath = path.join(__dirname, '../config/defaults.env');
var prodPath = path.join(__dirname, '../config/production.env');

function fileErrors() {
  process.stderr.write(
    'Looks like there is a problem with your config paths:\n' +
    '> ' + defaultPath + '\n' +
    '> ' + prodPath + '\n' +
    'See npm_tasks/build-config.js\n'
  );
  process.exit(1);
}

// Check paths to make sure they exist
try {
  if (!fs.statSync(defaultPath).isFile() || !fs.statSync(defaultPath)) {
    fileErrors();
  }
} catch (e) {
  fileErrors();
}

// Local environment in .env overwrites everything else
habitat.load('.env');

var environment = habitat.get('NODE_ENV', '').toLowerCase();


if (environment === 'production') {
  habitat.load(prodPath);
}

habitat.load(defaultPath);

var config = {
  CLIENT_ID: habitat.get('CLIENT_ID'),
  API_URI: habitat.get('API_URI'),
  LOGIN_URI: habitat.get('LOGIN_URI')
};

process.stdout.write(
  '// THIS IS A GENERATED FILE. EDIT npm_tasks/build-config.js INSTEAD\n' +
  'module.exports = ' + JSON.stringify(config) + ';\n'
);

{'fraction_non_alphanumeric': 0.17552961521833116, 'fraction_numerical': 0.0008646779074794639, 'mean_word_length': 4.096916299559472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4642220', 'n_tokens_mistral': 789, 'n_tokens_neox': 780, 'n_words': 178}