'use strict';


module.exports = function (grunt) {

    //npm install
    grunt.registerTask('npm_install', 'install dependencies', function() {
        var exec = require('child_process').exec;
        var cb = this.async();
        exec('npm install', {cwd: './'}, function(err, stdout) {
            console.log(stdout);
            cb();
        });
    });

    grunt.registerTask('open_coverage', 'open coverage report in default browser', function() {
        var exec = require('child_process').exec;
        var cb = this.async();
        exec('open coverage/lcov-report/index.html', {cwd: './'}, function(err, stdout) {
            console.log(stdout);
            cb();
        });
    });

    // Load the project's grunt tasks from a directory
    require('grunt-config-dir')(grunt, {
        configDir: require('path').resolve('tasks')
    });

    // Register group tasks
    // grunt.registerTask('build', [ 'jshint', 'i18n', 'copyto' ]);
    // grunt.registerTask('test', [ 'jshint', 'mochacli' ]);

    // Register group tasks
    grunt.registerTask('clean_all', [ 'clean:node_modules', 'clean:coverage', 'npm_install' ]);
    grunt.registerTask('test', ['env:test', 'clean:coverage', 'jshint', 'mocha_istanbul']);
    grunt.registerTask('coverage', ['test', 'open_coverage']);
    grunt.registerTask('zip', ['compress:icd10-api']);
    grunt.registerTask('serve', ['env:sandbox', 'jshint','develop','watch']);
};

@@ -46,16 +46,217 @@
 unt) %7B%0A%0A
+    // Load the project's grunt tasks from a directory%0A    require('grunt-config-dir')(grunt, %7B%0A        configDir: require('path').resolve('tasks')%0A    %7D);%0A%0A    /*%0A     * Register group tasks%0A     */%0A%0A
     //np
@@ -901,351 +901,8 @@
 );%0A%0A
-    // Load the project's grunt tasks from a directory%0A    require('grunt-config-dir')(grunt, %7B%0A        configDir: require('path').resolve('tasks')%0A    %7D);%0A%0A    // Register group tasks%0A    // grunt.registerTask('build', %5B 'jshint', 'i18n', 'copyto' %5D);%0A    // grunt.registerTask('test', %5B 'jshint', 'mochacli' %5D);%0A%0A    // Register group tasks%0A
     

Update grunt task ordering