<commit_before>const path = require("path");
const fs = require('fs');
const spawn  = require('cross-spawn');

function _parserPath(projectPath){
  return [process.cwd(), projectPath].join(path.sep)
}

function copy(root,destination){
  const destinationPath = _parserPath(destination)
  return spawn.sync('cp', ['-r', root, destinationPath]);
}

function isPathInUse(projectPath){
  const fullPath = _parserPath(projectPath)
  const isPathExists = fs.existsSync(fullPath)
  if(isPathExists) {
    return fs.readdirSync(fullPath).length
  }
  return isPathExists
}

module.exports = { copy, isPathInUse }<commit_msg>[refactor] [s]: update copy methods<commit_after>const path = require("path");
const fs = require('fs');
const spawn  = require('cross-spawn');

function parserPath(projectPath){
  return [process.cwd(), projectPath].join(path.sep)
}

function copy(root,destination){
  const destinationPath = parserPath(destination)
  return spawn.sync('cp', ['-r', root, destinationPath]);
}

function isPathInUse(projectPath){
  const fullPath = parserPath(projectPath)
  const isPathExists = fs.existsSync(fullPath)
  if(isPathExists) {
    return fs.readdirSync(fullPath).length
  }
  return isPathExists
}

module.exports = { parserPath, copy, isPathInUse }
{'fraction_non_alphanumeric': 0.13460015835312747, 'fraction_numerical': 0.0, 'mean_word_length': 5.945054945054945, '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': '3213963', 'n_tokens_mistral': 394, 'n_tokens_neox': 392, 'n_words': 85}