<commit_before>module.exports.loadSolution = function(menuItems, vspath) {
    const readline = require('readline');
    let menu = null;

    if (menuItems.length > 0) {
        for (var i = 0; i < menuItems.length; i++) {
            console.log(i + 1 + '. '  + menuItems[i]);
        }
    }
    console.log(menuItems.length + 1 + '. Exit');

    menu = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });

    menu.question('Select the solution to open? ', function(input) {
        let menuOption = parseInt(input);
        if (isNaN(menuOption)) {process.exit();}
        if ((menuOption-1) < menuItems.length){ 
            const execFile = require('child_process').execFile;
            execFile(vspath + '\\devenv.exe ', [ menuItems[menuOption-1] ], (error) => {
                if (error) { 
                    console.log('An error occured when trying to open your solution.  Ensure that you have Visual Studio 2017 installed.');
                    console.log(error);
                }
                if(menu) menu.close();
            });<commit_msg>Released process when Visual Studio opens.<commit_after>module.exports.loadSolution = function(menuItems, vspath) {
    const readline = require('readline');
    let menu = null;

    if (menuItems.length > 0) {
        for (var i = 0; i < menuItems.length; i++) {
            console.log(i + 1 + '. '  + menuItems[i]);
        }
    }
    console.log(menuItems.length + 1 + '. Exit');

    menu = readline.createInterface({
        input: process.stdin,
        output: process.stdout
    });

    menu.question('Select the solution to open? ', function(input) {
        let menuOption = parseInt(input);
        if (isNaN(menuOption)) {process.exit();}
        if ((menuOption-1) < menuItems.length){ 
            const {spawn} = require("child_process");
            const subprocess = spawn(vspath + '\\devenv.exe ', [ menuItems[menuOption-1] ], {
                detached: true,
                stdio: 'ignore'
            });
            subprocess.unref();
            if(menu) menu.close();
{'fraction_non_alphanumeric': 0.13946869070208728, 'fraction_numerical': 0.007590132827324478, 'mean_word_length': 2.078832116788321, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '4347277', 'n_tokens_mistral': 631, 'n_tokens_neox': 602, 'n_words': 141}