lib/templates.js
function (cb) {
      var templatesDir = self.data._templatesDir;
      var templatesPath = path.join(self.src, "extracted", templatesDir);

      fs.stat(templatesPath, function (err, stats) {
        if (err) {
          if (err.code === "ENOENT") {
            return void cb(
              new Error("Templates path '" + templatesPath + "' directory not found"));
          }

          return void cb(err);
        }

        if (!stats.isDirectory()) {
          return void cb(new Error(
            "Templates path '" + templatesPath + "' exists, but is not a directory"));
        }

        cb(null, templatesPath);
      });
    }
function (cb) {
      var templatesDir = self.data._templatesDir;
      var templatesPath = path.join(self.src, "extracted", templatesDir);

      fs.stat(templatesPath, function (err, stats) {
        if (err) {
          if (err.code === "ENOENT") {
            return void cb(
              new Error("Templates path '" + templatesPath + "' directory not found"));
          }

          return void cb(err);
        }

        if (!stats.isDirectory()) {
          return void cb(new Error(
            "Templates path '" + templatesPath + "' exists, but is not a directory"));
        }

        cb(null, templatesPath);
      });
    }
------------------------------------------------------------------------ Validate and add in templates directory source. ------------------------------------------------------------------------