var fs   = require('fs');
var glob = require('glob');
var path = require('path');

/**
 * Looks for files with .html, .hbs, or .handlebars extensions within the given directory, and adds them as Handlebars partials matching the name of the file.
 * @param {string} dir - Folder to check for partials.
 */
module.exports = function(dir) {
  var partials = glob.sync(path.join(dir, '**/*.{html,hbs,handlebars}'));

  for (var i in partials) {
    var file = fs.readFileSync(partials[i]);
    var name = path.basename(partials[i], '.html');
    this.Handlebars.registerPartial(name, file.toString() + '\n');
  }
}

var fs   = require('fs');
var glob = require('glob');
var path = require('path');

/**
 * Looks for files with .html, .hbs, or .handlebars extensions within the given directory, and adds them as Handlebars partials matching the name of the file.
 * @param {string} dir - Folder to check for partials.
 */
module.exports = function(dir) {
  var partials = glob.sync(path.join(dir, '**/*.{html,hbs,handlebars}'));

  for (var i in partials) {
    var ext = path.extname(partials[i]);
    var file = fs.readFileSync(partials[i]);
    var name = path.basename(partials[i], ext);
    this.Handlebars.registerPartial(name, file.toString() + '\n');
  }
}

Fix loading of partials according to generic file extension.
Fix loading of partials according to generic file extension.
