<commit_before>var fs = require("fs"), util = require("util");

module.exports = function (grunt) {
    var gruntConfig = {
        dist: "build"
    };

    grunt.loadNpmTasks("intern");

    grunt.initConfig({
        config: gruntConfig,
        clean: {
            dist: {
                files: [
                    {
                        dot: true,
                        src: [
                            "<%= config.dist %>/*",
                            "!<%= config.dist %>/.git*"
                        ]
                    }
                ]
            }
        },
        crx: {
            dist: {
                src: "extensions/chrome/",
                dest: "<%= config.dist %>/codebounty.crx",
                exclude: [".git", "*.pem"],
                privateKey: "extensions/chrome.pem"
            }
        },
        intern: {
            client: {
                options: {
                    config: "tests/intern",
                    suites: ["tests/lib/bounty"],
                    runType: "runner"
                }
            }
        },
        bgShell: {
            bitcoind: {
                cmd: "bitcoind",
                bg: true,
                stdout: false,
                stderr: false
            },
            meteor: {
                cmd: [
                    "cd meteor",
                    "meteor --settings settings.json"
                ].join("&&"),
                bg: false,
                stdout: true,
                stderr: true
            },
            debugmeteor: {
                cmd: [
                    "cd meteor",
                    "NODE_OPTIONS='--debug-brk' meteor --settings settings.json"
                ].join("&&"),
                bg: false,
                stdout: true,
                stderr: true
            }
        },
        encode: {
            client: {
                src: ["build/codebounty.crx"],
                dest: "build"
            }
        }
    });

    // Load all grunt tasks
    require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);

    //the intern chromeOptions needs the extension to be a Base64 encoded string
    //so encode it, then build a requirejs module for it
    grunt.registerMultiTask("encode", "Convert the .crx to a Base64 encoded string", function () {
        this.files.forEach(function (filePair) {
            var dest = filePair.dest;
            filePair.src.map(function (file) {
                var binaryData = fs.readFileSync(file);<commit_msg>Replace build folder path with config.dist<commit_after>var fs = require("fs"), util = require("util");

module.exports = function (grunt) {
    var gruntConfig = {
        dist: "build"
    };

    grunt.loadNpmTasks("intern");

    grunt.initConfig({
        config: gruntConfig,
        clean: {
            dist: {
                files: [
                    {
                        dot: true,
                        src: [
                            "<%= config.dist %>/*",
                            "!<%= config.dist %>/.git*"
                        ]
                    }
                ]
            }
        },
        crx: {
            dist: {
                src: "extensions/chrome/",
                dest: "<%= config.dist %>/codebounty.crx",
                exclude: [".git", "*.pem"],
                privateKey: "extensions/chrome.pem"
            }
        },
        intern: {
            client: {
                options: {
                    config: "tests/intern",
                    suites: ["tests/lib/bounty"],
                    runType: "runner"
                }
            }
        },
        bgShell: {
            bitcoind: {
                cmd: "bitcoind",
                bg: true,
                stdout: false,
                stderr: false
            },
            meteor: {
                cmd: [
                    "cd meteor",
                    "meteor --settings settings.json"
                ].join("&&"),
                bg: false,
                stdout: true,
                stderr: true
            },
            debugmeteor: {
                cmd: [
                    "cd meteor",
                    "NODE_OPTIONS='--debug-brk' meteor --settings settings.json"
                ].join("&&"),
                bg: false,
                stdout: true,
                stderr: true
            }
        },
        encode: {
            client: {
                src: ["<%= config.dist %>/codebounty.crx"],
                dest: "<%= config.dist %>"
            }
        }
    });

    // Load all grunt tasks
    require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);

    //the intern chromeOptions needs the extension to be a Base64 encoded string
    //so encode it, then build a requirejs module for it
    grunt.registerMultiTask("encode", "Convert the .crx to a Base64 encoded string", function () {
        this.files.forEach(function (filePair) {
            var dest = filePair.dest;
            filePair.src.map(function (file) {
                var binaryData = fs.readFileSync(file);
{'fraction_non_alphanumeric': 0.11959287531806616, 'fraction_numerical': 0.0015658641612840086, 'mean_word_length': 0.9706903200925568, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1913060', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1262, 'n_words': 281}