Skip to content

Commit

Permalink
Remove async keyword from Promise executor in registerLocalHooks
Browse files Browse the repository at this point in the history
Changes made:
- Removed 'async' keyword from the Promise executor function in registerLocalHooks
- No other modifications were made to preserve the original functionality
  • Loading branch information
thebedigupta authored Oct 9, 2024
1 parent 0579c0a commit c83011d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/generator/lib/hooksRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ module.exports.registerHooks = async (hooks, templateConfig, templateDir, hooksD
* @returns {Promise<Object>} - A promise that resolves to the updated hooks object.
*/
async function registerLocalHooks(hooks, templateDir, hooksDir) {
const localHooks = path.resolve(templateDir, hooksDir);
return new Promise((resolve, reject) => {
const localHooks = path.resolve(templateDir, hooksDir);

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

return new Promise((resolve, reject) => {
const walker = xfs.walk(localHooks, {
followLinks: false
});
Expand All @@ -56,7 +56,7 @@ async function registerLocalHooks(hooks, templateDir, hooksDir) {
reject(nodeStatsArray);
});

walker.on('end', () => {
walker.on('end', async () => {
resolve(hooks);
});
});
Expand Down

0 comments on commit c83011d

Please sign in to comment.