<commit_before>/* jshint node: true */

module.exports = function(grunt) {
	"use strict";

	var fs = require('fs')
		,_ = require('underscore')
		,path = require('path');





	var init_project = function(project_name){
		if (grunt.config.get('initialized') == true) return grunt.config.get('project');
		if (! project_name){
			grunt.log.error('Specify a project name like this... grunt <command>:project-name');
			return false;
		}
		var p = path.join('projects', project_name);
		var cfg_path = path.join(p, 'project.json');
		var project;
		if (fs.existsSync(cfg_path)){
			project = grunt.file.readJSON(cfg_path);
		} else {
			project = {
				name: project_name
				, description: 'New project. Put your description here.'
				, version: '0.0.0'
				, targets: []
			};
		}

		var version = project.version.split('.');
		var last = parseInt(version.pop());
		version.push(last + 1);
		project.version = version.join('.');

		var cfg = {
			initialized: true,
			pkg: grunt.file.readJSON('package.json'),
			project: project,
			project_path: p,
			date: new Date().toUTCString(),
			bootstrap_directory: path.resolve('bootstrap'),
			bootstrap_pkg: grunt.file.readJSON('bootstrap/package.json'),
			banner: '/*!\n' +
				' * <%= project.name %> v. <%= project.version %> Compiled by <%= pkg.english_name %> at <%= date %>.\n' +
				' * \n' +
				' * Bootstrap v<%= bootstrap_pkg.version %> by @fat and @mdo\n' +
				' * Copyright <%= grunt.template.today("yyyy") %> <%= bootstrap_pkg.author %>\n' +
				' * Licensed under <%= _.pluck(bootstrap_pkg.licenses, "url").join(", ") %>\n' +
				' *\n' +
				' * Designed and built with all the love in the world by @mdo and @fat.\n' +
				' */\n',
			jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',
			recess: {
				options: {
					compile: true,
					banner: '<%= banner %>'
				},
				full: {
					src: ['projects/<%= project.name %>/less/style.less'],
					dest: 'projects/<%= project.name %>/assets/css/style.css'
				},
				min: {
					options: {
						compress: true
					},
					src: ['projects/<%= project.name %>/less/style.less'],
					dest: 'projects/<%= project.name %>/assets/css/style.min.css'
				}
			},
			uglify: {
				options: {
					banner: '<%= banner %>',
					report: 'min'
				},
				bootstrap: {
					src: ['<%= concat.bootstrap.dest %>'],
					dest: 'projects/<%= project.name %>/assets/js/<%= bootstrap_pkg.name %>.min.js'
				}
			},
			concat: {
				options: {
					banner: '<%= banner %><%= jqueryCheck %>',
					stripBanners: false
				},
				bootstrap: {
					src: [
						'<%= bootstrap_directory %>/js/transition.js',
						'<%= bootstrap_directory %>/js/alert.js',
						'<%= bootstrap_directory %>/js/button.js',
						'<%= bootstrap_directory %>/js/carousel.js',
						'<%= bootstrap_directory %>/js/collapse.js',
						'<%= bootstrap_directory %>/js/dropdown.js',
						'<%= bootstrap_directory %>/js/modal.js',
						'<%= bootstrap_directory %>/js/tooltip.js',
						'<%= bootstrap_directory %>/js/popover.js',
						'<%= bootstrap_directory %>/js/scrollspy.js',
						'<%= bootstrap_directory %>/js/tab.js',
						'<%= bootstrap_directory %>/js/affix.js'
					],
					dest: 'projects/<%= project.name %>/assets/js/<%= bootstrap_pkg.name %>.js'
				}
			},

			clean: {
				options: {force: true},
				css: [],
				fonts: [],
				js: []
			},
			copy: {
				init_project: {
					files: [
						{
							expand: true,
							src: ['**'],
							dest: 'projects/<%= project.name %>',
							cwd: 'sample-project/'
						}
					]

				},
				update_fonts: {
					files: [
						{
							expand: true,
							src: ['**'],
							dest: 'projects/<%= project.name %>/assets/fonts',
							cwd: '<%= bootstrap_directory %>/fonts/'
						}
					]

				},


				js: {
					files: []
				},
				css: {
					files: []
				}
			},
			watch: {
				recess: {
					files: 'projects/<%= project.name %>/less/*',
					tasks: ['compile:<%= project.name %>']
				}
			}
		};




		_.each(project.targets, function(target){

			cfg.copy.update_fonts.files.push({<commit_msg>made it so that any target's fonts dir is cleaned befor copying from the project<commit_after>/* jshint node: true */

module.exports = function(grunt) {
	"use strict";

	var fs = require('fs')
		,_ = require('underscore')
		,path = require('path');





	var init_project = function(project_name){
		if (grunt.config.get('initialized') == true) return grunt.config.get('project');
		if (! project_name){
			grunt.log.error('Specify a project name like this... grunt <command>:project-name');
			return false;
		}
		var p = path.join('projects', project_name);
		var cfg_path = path.join(p, 'project.json');
		var project;
		if (fs.existsSync(cfg_path)){
			project = grunt.file.readJSON(cfg_path);
		} else {
			project = {
				name: project_name
				, description: 'New project. Put your description here.'
				, version: '0.0.0'
				, targets: []
			};
		}

		var version = project.version.split('.');
		var last = parseInt(version.pop());
		version.push(last + 1);
		project.version = version.join('.');

		var cfg = {
			initialized: true,
			pkg: grunt.file.readJSON('package.json'),
			project: project,
			project_path: p,
			date: new Date().toUTCString(),
			bootstrap_directory: path.resolve('bootstrap'),
			bootstrap_pkg: grunt.file.readJSON('bootstrap/package.json'),
			banner: '/*!\n' +
				' * <%= project.name %> v. <%= project.version %> Compiled by <%= pkg.english_name %> at <%= date %>.\n' +
				' * \n' +
				' * Bootstrap v<%= bootstrap_pkg.version %> by @fat and @mdo\n' +
				' * Copyright <%= grunt.template.today("yyyy") %> <%= bootstrap_pkg.author %>\n' +
				' * Licensed under <%= _.pluck(bootstrap_pkg.licenses, "url").join(", ") %>\n' +
				' *\n' +
				' * Designed and built with all the love in the world by @mdo and @fat.\n' +
				' */\n',
			jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n',
			recess: {
				options: {
					compile: true,
					banner: '<%= banner %>'
				},
				full: {
					src: ['projects/<%= project.name %>/less/style.less'],
					dest: 'projects/<%= project.name %>/assets/css/style.css'
				},
				min: {
					options: {
						compress: true
					},
					src: ['projects/<%= project.name %>/less/style.less'],
					dest: 'projects/<%= project.name %>/assets/css/style.min.css'
				}
			},
			uglify: {
				options: {
					banner: '<%= banner %>',
					report: 'min'
				},
				bootstrap: {
					src: ['<%= concat.bootstrap.dest %>'],
					dest: 'projects/<%= project.name %>/assets/js/<%= bootstrap_pkg.name %>.min.js'
				}
			},
			concat: {
				options: {
					banner: '<%= banner %><%= jqueryCheck %>',
					stripBanners: false
				},
				bootstrap: {
					src: [
						'<%= bootstrap_directory %>/js/transition.js',
						'<%= bootstrap_directory %>/js/alert.js',
						'<%= bootstrap_directory %>/js/button.js',
						'<%= bootstrap_directory %>/js/carousel.js',
						'<%= bootstrap_directory %>/js/collapse.js',
						'<%= bootstrap_directory %>/js/dropdown.js',
						'<%= bootstrap_directory %>/js/modal.js',
						'<%= bootstrap_directory %>/js/tooltip.js',
						'<%= bootstrap_directory %>/js/popover.js',
						'<%= bootstrap_directory %>/js/scrollspy.js',
						'<%= bootstrap_directory %>/js/tab.js',
						'<%= bootstrap_directory %>/js/affix.js'
					],
					dest: 'projects/<%= project.name %>/assets/js/<%= bootstrap_pkg.name %>.js'
				}
			},

			clean: {
				options: {force: true},
				css: [],
				update_fonts: [],
				js: []
			},
			copy: {
				init_project: {
					files: [
						{
							expand: true,
							src: ['**'],
							dest: 'projects/<%= project.name %>',
							cwd: 'sample-project/'
						}
					]

				},
				update_fonts: {
					files: [
						{
							expand: true,
							src: ['**'],
							dest: 'projects/<%= project.name %>/assets/fonts',
							cwd: '<%= bootstrap_directory %>/fonts/'
						}
					]

				},


				js: {
					files: []
				},
				css: {
					files: []
				}
			},
			watch: {
				recess: {
					files: 'projects/<%= project.name %>/less/*',
					tasks: ['compile:<%= project.name %>']
				}
			}
		};




		_.each(project.targets, function(target){
			cfg.clean.update_fonts.push(target + '/assets/fonts');
			cfg.copy.update_fonts.files.push({
{'fraction_non_alphanumeric': 0.2005042622163525, 'fraction_numerical': 0.0009604994597190539, 'mean_word_length': 2.5461898680289483, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, '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': '2913014', 'n_tokens_mistral': 3882, 'n_tokens_neox': 2831, 'n_words': 557}