<commit_before>// @flow

require('dotenv').config({silent: true})
var path = require('path')

if (!process.env.BUILD_DIR) {
  process.env.BUILD_DIR = 'build'
  if (process.env.TARGET) process.env.BUILD_DIR = path.join(process.env.BUILD_DIR, process.env.TARGET)
}
process.env.BUILD_DIR = path.resolve(__dirname, process.env.BUILD_DIR)

var defaults = {
  PORT: '3000',
  ROOT_URL: 'http://localhost:3000',
  MONGO_URL: 'mongodb://localhost:27017/crater',
  METEOR_SETTINGS: '{"public": {"test": "success"}}',
}

for (var key in defaults) process.env[key] = defaults[key]

<commit_msg>fix(getenv): only replace undefined environment variables<commit_after>// @flow

require('dotenv').config({silent: true})
var path = require('path')

if (!process.env.BUILD_DIR) {
  process.env.BUILD_DIR = 'build'
  if (process.env.TARGET) process.env.BUILD_DIR = path.join(process.env.BUILD_DIR, process.env.TARGET)
}
process.env.BUILD_DIR = path.resolve(__dirname, process.env.BUILD_DIR)

var defaults = {
  PORT: '3000',
  ROOT_URL: 'http://localhost:3000',
  MONGO_URL: 'mongodb://localhost:27017/crater',
  METEOR_SETTINGS: '{"public": {"test": "success"}}',
}

for (var key in defaults) {
  if (process.env[key] == null) process.env[key] = defaults[key]
}


{'fraction_non_alphanumeric': 0.1781701444622793, 'fraction_numerical': 0.02086677367576244, 'mean_word_length': 5.266331658291457, 'pattern_counts': {'":': 4, '<': 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': '6141742', 'n_tokens_mistral': 472, 'n_tokens_neox': 446, 'n_words': 84}