<commit_before>const path = require("path");
const fs = require("fs");
const SevenZip = require('7zip-bin');
const chld = require('child_process');

const emulators = [
    'NES',
    'SG',
    'SNES',
    'GB',
    'GBC',
    'GBA',
    'DS',
    '32X',
    'GEN',
    'N64',
    'MS',
    'AT26',
    'LYNX',
    'GG',
    'NGP',
    'NGC',
    'PC',
    'ZMAC'
];

const extensions = [
    [".nes", ".smc", ".sfc", ".fig", ".swc", ".mgd", ".fds"],
    [".sg"],
    [".smc", ".sfc", ".fig", ".swc"],
    [".gb"],
    [".gbc"],
    [".gba"],
    [".nds"],
    [".32x", ".smd", ".bin", ".md"],
    [".smd", ".bin", ".md", ".iso", ".gen"],
    [".z64", ".n64", ".v64"],
    [".sms"],
    [".bin", ".a26", ".rom", ".gz"],
    [".lnx"],
    [".gg"],
    [".ngp"],
    [".ngc"],
    [".pce", ".cue"],
    [".dat", ".z1", ".z2", ".z3", ".z4", ".z5", ".z6", ".z7", ".z8"]
];

var extracted;

function extract(dest,name) {
    var exportPath = dest + '/' + name;
    chld.execSync(SevenZip.path7za + ' x ' + '"' + exportPath + '" -o"' + dest + '/RetroManagerExtract/"',
      function (error, stdout, stderr) {
        // console.log('stdout: ' + stdout);
        // console.log('stderr: ' + stderr);
        if (error !== null) {
          console.log('exec error: ' + error);
        }
    });
}
function compress(dest,name) {
    var inputPath;
    // console.log(extracted);
    if (extracted) {
        inputPath = dest + '/RetroManagerExtract/' + name;
    } else {
        inputPath = dest + '/' + name;
    }
    // console.log(inputPath);
    chld.execSync(SevenZip.path7za + ' a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on ' + '"' + dest + '/RetroManagerCompress/' + path.parse(name).name + '.7z" "' + inputPath + '"',
      function (error, stdout, stderr) {
        // console.log('stdout: ' + stdout);
        // console.log('stderr: ' + stderr);
        if (error !== null) {
          console.log('exec error: ' + error);
        }
    });
}
<commit_msg>Add path.resolve() to ensure directory compatibility cross-platform<commit_after>const path = require("path");
const fs = require("fs");
const SevenZip = require('7zip-bin');
const chld = require('child_process');

const emulators = [
    'NES',
    'SG',
    'SNES',
    'GB',
    'GBC',
    'GBA',
    'DS',
    '32X',
    'GEN',
    'N64',
    'MS',
    'AT26',
    'LYNX',
    'GG',
    'NGP',
    'NGC',
    'PC',
    'ZMAC'
];

const extensions = [
    [".nes", ".smc", ".sfc", ".fig", ".swc", ".mgd", ".fds"],
    [".sg"],
    [".smc", ".sfc", ".fig", ".swc"],
    [".gb"],
    [".gbc"],
    [".gba"],
    [".nds"],
    [".32x", ".smd", ".bin", ".md"],
    [".smd", ".bin", ".md", ".iso", ".gen"],
    [".z64", ".n64", ".v64"],
    [".sms"],
    [".bin", ".a26", ".rom", ".gz"],
    [".lnx"],
    [".gg"],
    [".ngp"],
    [".ngc"],
    [".pce", ".cue"],
    [".dat", ".z1", ".z2", ".z3", ".z4", ".z5", ".z6", ".z7", ".z8"]
];

var extracted;

function extract(dest,name) {
    var exportPath = path.resolve(dest, name);
    chld.execSync(SevenZip.path7za + ' x ' + '"' + exportPath + '" -o"' + path.resolve(dest, 'RetroManagerExtract') + '/"',
      function (error, stdout, stderr) {
        // console.log('stdout: ' + stdout);
        // console.log('stderr: ' + stderr);
        if (error !== null) {
          console.log('exec error: ' + error);
        }
    });
}
function compress(dest,name) {
    var inputPath;
    // console.log(extracted);
    if (extracted) {
        inputPath = path.resolve(path.resolve(dest, 'RetroManagerExtract'), name);
    } else {
        inputPath = path.resolve(dest, name);
    }
    // console.log(inputPath);
    chld.execSync(SevenZip.path7za + ' a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on ' + '"' + path.resolve(path.resolve(dest, 'RetroManagerCompress'), path.parse(name).name) + '.7z" "' + inputPath + '"',
      function (error, stdout, stderr) {
        // console.log('stdout: ' + stdout);
        // console.log('stderr: ' + stderr);
        if (error !== null) {
          console.log('exec error: ' + error);
        }
    });
}

{'fraction_non_alphanumeric': 0.261652281134402, 'fraction_numerical': 0.01726263871763255, 'mean_word_length': 2.229299363057325, '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': '54767', 'n_tokens_mistral': 1598, 'n_tokens_neox': 1563, 'n_words': 312}