<commit_before>const exec = require('child_process').exec;

exports.handle = function(event, context) {
    console.log('starting app with event', event);
    exec('./main --json="'+ JSON.stringify(event) + '"', function(error, stdout) {
        console.log('app exited');
        console.log('error:', error);
        console.log('stdout:', stdout);
        context.done(error, JSON.parse(stdout));
    });
}<commit_msg>replace exec by execFile in run.js to avoid spawning a shell<commit_after>const { execFile } = require('child_process');

exports.handle = function(event, context) {
    console.log('starting app with event', event);
    execFile('./main', ['--json', '"'+ JSON.stringify(event) + '"'], function(error, stdout) {
        console.log('app exited');
        console.log('error:', error);
        console.log('stdout:', stdout);
        context.done(error, JSON.parse(stdout));
    });
}
{'fraction_non_alphanumeric': 0.1847345132743363, 'fraction_numerical': 0.0, 'mean_word_length': 3.7135416666666665, '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': '2514230', 'n_tokens_mistral': 268, 'n_tokens_neox': 263, 'n_words': 58}