async function registerLocalHooks(hooks, templateDir, hooksDir) {
  return new Promise(async (resolve, reject) => {
    const localHooks = path.resolve(templateDir, hooksDir);

    if (!await exists(localHooks)) return resolve(hooks);

    const walker = xfs.walk(localHooks, {
      followLinks: false
    });
    
    walker.on('file', async (root, stats, next) => {
      try {
        const filePath = path.resolve(templateDir, path.resolve(root, stats.name));
        
        registerTypeScript(filePath);

        delete require.cache[require.resolve(filePath)];
        const mod = require(filePath);

        addHook(hooks, mod);

        next();
      } catch (e) {
        reject(e);
      }
    });

    walker.on('errors', (root, nodeStatsArray) => {
      reject(nodeStatsArray);
    });

    walker.on('end', async () => {
      resolve(hooks);
    });
  });
}
Loads the local template hooks from default location.
@private
@param {Object} hooks Object that stores information about all available hook functions grouped by the type of the hook.
@param {String} templateDir Directory where template is located.
@param {String} hooksDir Directory where local hooks are located.