<commit_before>module Docs
  class CreateGitFiles < Services::Base
    def call(doc)
      check_uniqueness doc.project.id
      git = Projects::OpenGit.call(doc.project)
      git.checkout doc.tag
      if File.exist?(doc.local_git_path)
        FileUtils.rm_rf doc.local_git_path
      end
      FileUtils.cp_r doc.project.local_path, doc.local_git_path
    end
  end
end<commit_msg>create parent folder if it doesnt exist yet<commit_after>module Docs
  class CreateGitFiles < Services::Base
    def call(doc)
      check_uniqueness doc.project.id
      git = Projects::OpenGit.call(doc.project)
      git.checkout doc.tag
      if File.exist?(doc.local_git_path)
        FileUtils.rm_rf doc.local_git_path
      else
        FileUtils.mkdir_p doc.local_git_path.dirname
      end
      FileUtils.cp_r doc.project.local_path, doc.local_git_path
    end
  end
end
{'fraction_non_alphanumeric': 0.07523148148148148, 'fraction_numerical': 0.0, 'mean_word_length': 2.967889908256881, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7643245', 'n_tokens_mistral': 292, 'n_tokens_neox': 285, 'n_words': 57}