<commit_before>/*
 * grunt-itbldz-init
 * https://github.com/MatthiasKainer/grunt-itbldz-init
 *
 * Copyright (c) 2015 MatthiasKainer
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {
    
    var questions = require('../lib/question.js');
    var storage = require('../lib/fileCreation.js');
    
    grunt.registerTask('store-initialized-itbldz-config', 'called automatically', function () {
        var config = grunt.config("itbldz");
        if (config) {
            
            storage.Create.config(config);

            if (config._.some(function (x) { return x === "build" }))
                storage.Create.build(config);

            if (config._.some(function (x) { return x === "deploy" }))
                storage.Create.deploy(config);
            
        }

        grunt.log.ok("Setup complete. Run 'build-it' to start the build.");
        grunt.log.ok("You can always customize this setup by editing the *.json this assistant has created.");
    });

    grunt.registerTask('init-itbldz', 'Initalization script for itbldz', function () {
        
        var config = questions.setUp();
        grunt.verbose.writeln(config);
        grunt.initConfig({
            "prompt" : {
                "init" : {
                    "options" : {
                        "questions" : config
                    }
                }
            }
        });

        grunt.loadNpmTasks('grunt-prompt');
        grunt.task.run([ "prompt", 'store-initialized-itbldz-config']);
    });
};<commit_msg>chdir before loading npm tasks because if used from another module, the loading would fail<commit_after>/*
 * grunt-itbldz-init
 * https://github.com/MatthiasKainer/grunt-itbldz-init
 *
 * Copyright (c) 2015 MatthiasKainer
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {
    
    var questions = require('../lib/question.js');
    var storage = require('../lib/fileCreation.js');
    
    grunt.registerTask('store-initialized-itbldz-config', 'called automatically', function () {
        var config = grunt.config("itbldz");
        if (config) {
            
            storage.Create.config(config);

            if (config._.some(function (x) { return x === "build" }))
                storage.Create.build(config);

            if (config._.some(function (x) { return x === "deploy" }))
                storage.Create.deploy(config);
            
        }

        grunt.log.ok("Setup complete. Run 'build-it' to start the build.");
        grunt.log.ok("You can always customize this setup by editing the *.json this assistant has created.");
    });

    grunt.registerTask('init-itbldz', 'Initalization script for itbldz', function () {
        
        var config = questions.setUp();
        grunt.verbose.writeln(config);
        grunt.initConfig({
            "prompt" : {
                "init" : {
                    "options" : {
                        "questions" : config
                    }
                }
            }
        });

        var cwd = process.cwd();
        process.chdir(__dirname + "/..");
        grunt.loadNpmTasks('grunt-prompt');
        process.chdir(cwd);
        grunt.task.run([ "prompt", 'store-initialized-itbldz-config']);
    });
};
{'fraction_non_alphanumeric': 0.14190012180267966, 'fraction_numerical': 0.00243605359317905, 'mean_word_length': 1.8790534618755477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7351254', 'n_tokens_mistral': 985, 'n_tokens_neox': 939, 'n_words': 197}