<commit_before>#!/bin/bash

checkEnvironmentVariables() {
  echo 'Checking for required environment variables....'
  if [[ -z $DB_USERNAME ]]; then
    echo 'DB_USERNAME not found. Exiting.'
    exit 1;
  elif [[ -z $DB_PASSWORD ]]; then
    echo 'DB_PASSWORD not found. Exiting.'
    exit 1;
  elif [[ -z $DB_HOST ]]; then
    echo 'DB_HOST not found. Exiting.'
    exit 1;
  elif [[ -z $DB_PORT ]]; then
    echo 'DB_PORT not found. Exiting.'
    exit 1;
  elif [[ -z $DB_NAME ]]; then
    echo 'DB_NAME not found. Exiting.'
    exit 1;
  fi
  echo 'All variables are present.'
}
exportVariables() {
  export readonly RANDOM_NUMBER=$(date +%s-%N)
  export readonly DB_URL="mongodb://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
}
startCron() {
  cd /home/harry/box
  echo 'cron running without forever'
  node cron.js
}
main() {
  checkEnvironmentVariables
  exportVariables<commit_msg>uses only one env variable<commit_after>#!/bin/bash

checkEnvironmentVariables() {
  echo 'Checking for required environment variables....'
  if [[ -z $DB_URL ]]; then
    echo 'DB_URL not found. Exiting.'
    exit 1;
  fi
  # if [[ -z $DB_USERNAME ]]; then
  #   echo 'DB_USERNAME not found. Exiting.'
  #   exit 1;
  # elif [[ -z $DB_PASSWORD ]]; then
  #   echo 'DB_PASSWORD not found. Exiting.'
  #   exit 1;
  # elif [[ -z $DB_HOST ]]; then
  #   echo 'DB_HOST not found. Exiting.'
  #   exit 1;
  # elif [[ -z $DB_PORT ]]; then
  #   echo 'DB_PORT not found. Exiting.'
  #   exit 1;
  # elif [[ -z $DB_NAME ]]; then
  #   echo 'DB_NAME not found. Exiting.'
  #   exit 1;
  # fi
  echo 'All variables are present.'
}
exportVariables() {
  export readonly RANDOM_NUMBER=$(date +%s-%N)
  # export readonly DB_URL="mongodb://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
}
startCron() {
  cd /home/harry/box
  echo 'cron running without forever'
  node cron.js
}
main() {
  checkEnvironmentVariables
  exportVariables
{'fraction_non_alphanumeric': 0.14866255144032922, 'fraction_numerical': 0.00565843621399177, 'mean_word_length': 3.182795698924731, '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': '2569115', 'n_tokens_mistral': 715, 'n_tokens_neox': 695, 'n_words': 195}