'use strict';

module.exports = function(grunt) {

  var ph_libutil = require("phantomizer-libutil");
  var phantomizer_helper = ph_libutil.phantomizer_helper;

  grunt.registerMultiTask("phantomizer-dir-inject-html-extras",
    "Scans a directory and inject extra html into all html / htm files", function () {

      var options = this.options();

      var in_dir = options.in_dir;

      var requirejs_src = options.requirejs.src;
      var requirejs_baseUrl = options.requirejs.baseUrl;
      var requirejs_paths = options.requirejs.paths;

      var files = grunt.file.expand(in_dir+"**/*.{html,htm}");

      for( var n in files ){
        var file = files[n];
        var retour = grunt.file.read(file);
        retour = inject_extras(retour,requirejs_baseUrl,requirejs_src, requirejs_paths);
        grunt.file.write(file, retour);
        grunt.log.ok("Extras inject in "+file)
      }
    });
  function inject_extras(buf,requirejs_baseUrl,requirejs_src, requirejs_paths){
    buf = phantomizer_helper.inject_requirejs(requirejs_baseUrl, requirejs_src, requirejs_paths, buf, null)

    var injected = '/js/vendors/go-phantomizer/extras-loader.js';
    buf = phantomizer_helper.inject_after_requirejs(requirejs_baseUrl,requirejs_src, requirejs_paths, buf, injected)
    return buf;
  };
};
@@ -44,16 +44,57 @@
 unt) %7B%0A%0A
+  var ProgressBar = require(%22progress%22);%0A
   var ph
@@ -132,24 +132,24 @@
 -libutil%22);%0A
-
   var phanto
@@ -642,16 +642,322 @@
 ,htm%7D%22);
+%0A      grunt.log.ok(%22Files Count %22+files.length);%0A%0A%0A// initialize a progress bar%0A      var bar = new ProgressBar(' done=%5B:current/:total%5D elapsed=%5B:elapseds%5D sprint=%5B:percent%5D eta=%5B:etas%5D %5B:bar%5D', %7B%0A        complete: '#'%0A        , incomplete: '-'%0A        , width: 80%0A        , total: files.length%0A      %7D);
 %0A%0A      
@@ -1191,27 +1191,31 @@
       grunt.
-log
+verbose
 .ok(%22Extras 
@@ -1231,16 +1231,37 @@
  %22+file)
+;%0A        bar.tick();
 %0A      %7D

Add progress depdendency Improved console output