<commit_before>#!/usr/bin/env ruby

require "json"

# pick a custom env file if set
if File.exists?("/tmp/envfile")
  custom_env = true
  file = File.read("/tmp/envfile").strip
else
  custom_env = false
  file = File.join(Dir.pwd, "../../../.env")
end

puts "Reading env from #{file}"

dotenv = begin
  # find that above node_modules/react-native-config/ios/
  raw = File.read(file)
  raw.split("\n").inject({}) do |h, line|
    key, val = line.split("=", 2)
    if line.strip.empty? or line.start_with?('#')
      h
    else<commit_msg>Fix inconsistency in file path when using /tmp/envfile<commit_after>#!/usr/bin/env ruby

require "json"

# pick a custom env file if set
if File.exists?("/tmp/envfile")
  custom_env = true
  file = File.read("/tmp/envfile").strip
else
  custom_env = false
  file = ".env"
end

puts "Reading env from #{file}"

dotenv = begin
  # find that above node_modules/react-native-config/ios/
  raw = File.read(File.join(Dir.pwd, "../../../#{file}"))
  raw.split("\n").inject({}) do |h, line|
    key, val = line.split("=", 2)
    if line.strip.empty? or line.start_with?('#')
      h
    else
{'fraction_non_alphanumeric': 0.17946428571428572, 'fraction_numerical': 0.0017857142857142857, 'mean_word_length': 3.151851851851852, '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': '4659634', 'n_tokens_mistral': 412, 'n_tokens_neox': 404, 'n_words': 108}