<commit_before>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            images: {
                expand: true,
                cwd: 'src/media',
                src: ['*', '!powered_by.png'],
                dest: 'build/static/media/'
            },
            background: {
                files: [{
                    src: 'background.html',
                    dest: 'build/background.html'
                }, {
                    src: 'src/background.js',
                    dest: 'build/static/js/background.js'
                }]
            },
            manifest: {
                src: 'manifest.json',
                dest: 'build/manifest.json'
            }
        },
        exec: {
            build: {
                command: './node_modules/.bin/react-scripts build'
            }
        },
        compress: {
            package: {
                options: {
                    archive: 'packages/<%= pkg.name %>-<%= pkg.version %>.zip'
                },
                files: [{
                    expand: false,
                    src: ['build/**'],
                    dest: '/'
                }]
            }
        },
        'json-replace': {
            options: {
                space: '  '
            },
            version: {
                options: {
                    replace: {
                        version: '<%= pkg.version %>'
                    }
                },
                files: [{
                    src: 'package.json',
                    dest: 'package.json'
                }, {
                    src: 'manifest.json',
                    dest: 'manifest.json'
                }]
            },
        },
        watch: {
            scripts: {
                files: 'src/**',
                tasks: ['exec', 'copy'],
                options: {
                    interrupt: true,
                },
            },
        }
    });

    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-exec');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-json-replace');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('build-extension', '', function(version) {
        if (version) {
            grunt.config.set('pkg.version', version);
            grunt.task.run('json-replace:version');
        } else {
            grunt.log.writeln('WARNING: did not update version!');
        }
        grunt.task.run([
            'exec:build',
            'copy',
            'compress'
        ]);
    });

    grunt.registerTask('default', ['copy']);
};<commit_msg>Add version argument<commit_after>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            images: {
                expand: true,
                cwd: 'src/media',
                src: ['*', '!powered_by.png'],
                dest: 'build/static/media/'
            },
            background: {
                files: [{
                    src: 'background.html',
                    dest: 'build/background.html'
                }, {
                    src: 'src/background.js',
                    dest: 'build/static/js/background.js'
                }]
            },
            manifest: {
                src: 'manifest.json',
                dest: 'build/manifest.json'
            }
        },
        exec: {
            build: {
                command: './node_modules/.bin/react-scripts build'
            }
        },
        compress: {
            package: {
                options: {
                    archive: 'packages/<%= pkg.name %>-<%= pkg.version %>.zip'
                },
                files: [{
                    expand: false,
                    src: ['build/**'],
                    dest: '/'
                }]
            }
        },
        'json-replace': {
            options: {
                space: '  '
            },
            version: {
                options: {
                    replace: {
                        version: '<%= pkg.version %>'
                    }
                },
                files: [{
                    src: 'package.json',
                    dest: 'package.json'
                }, {
                    src: 'manifest.json',
                    dest: 'manifest.json'
                }]
            },
        },
        watch: {
            scripts: {
                files: 'src/**',
                tasks: ['exec', 'copy'],
                options: {
                    interrupt: true,
                },
            },
        }
    });

    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-exec');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-json-replace');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('build-extension', '', function(v) {
        var version = process.env.npm_config_newV || v;

        if (version) {
            grunt.config.set('pkg.version', version);
            grunt.task.run('json-replace:version');
        } else {
            grunt.log.writeln('WARNING: did not update version!');
        }
        grunt.task.run([
            'exec:build',
            'copy',
            'compress'
        ]);
    });

    grunt.registerTask('default', ['copy']);
};
{'fraction_non_alphanumeric': 0.13885819521178638, 'fraction_numerical': 0.0, 'mean_word_length': 0.9606498194945848, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2070404', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1364, 'n_words': 206}