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

import * as fse from 'fs-extra';
import * as yargs from 'yargs';

const argv = yargs
  .usage('Usage: $0 [-L] source target')
  .demand(2, 2)
  .boolean('d')
  .alias('d', 'dereference')
  .describe('d', 'Dereference symlinks')
  .help('h')
  .alias('h', 'help').argv;

const source = argv._[0];
const target = argv._[1];
const options: fse.CopyOptions = {
  dereference: argv.dereference,
  overwrite: true,
};
<commit_msg>Enabled copying to a directory 📂<commit_after>#!/usr/bin/env node

import * as fs from 'fs';
import * as fse from 'fs-extra';
import * as path from 'path';
import * as yargs from 'yargs';

const argv = yargs
  .usage('Usage: $0 [-L] source target')
  .demand(2, 2)
  .boolean('d')
  .alias('d', 'dereference')
  .describe('d', 'Dereference symlinks')
  .help('h')
  .alias('h', 'help').argv;

const source = argv._[0];
let target = argv._[1];
const options: fse.CopyOptions = {
  dereference: argv.dereference,
  overwrite: true,
};

if (fse.pathExistsSync(target) && fs.lstatSync(target).isDirectory()) {
  target = path.join(target, source);
}

{'fraction_non_alphanumeric': 0.18806509945750452, 'fraction_numerical': 0.009041591320072333, 'mean_word_length': 4.148837209302326, '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': '5150509', 'n_tokens_mistral': 425, 'n_tokens_neox': 409, 'n_words': 109}