Skip to content

Commit

Permalink
Removed the async keyword from the Promise executor function and undo…
Browse files Browse the repository at this point in the history
… the last commit
  • Loading branch information
thebedigupta committed Oct 10, 2024
1 parent 074e520 commit c619de0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apps/generator/lib/hooksRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ module.exports.registerHooks = async (hooks, templateConfig, templateDir, hooksD
* @param {String} templateDir Directory where template is located.
* @param {String} hooksDir Directory where local hooks are located.
*/
async function registerLocalHooks(hooks, templateDir, hooksDir) {
return new Promise(async (resolve, reject) => {
function registerLocalHooks(hooks, templateDir, hooksDir) {
return new Promise((resolve, reject) => {
const localHooks = path.resolve(templateDir, hooksDir);

if (!await exists(localHooks)) return resolve(hooks);
exists(localHooks).then(localHooksExist => {
if (!localHooksExist) return resolve(hooks);

const walker = xfs.walk(localHooks, {
followLinks: false
Expand Down Expand Up @@ -58,7 +59,8 @@ async function registerLocalHooks(hooks, templateDir, hooksDir) {
walker.on('end', async () => {
resolve(hooks);
});
});
}).catch(reject);
});
}

/**
Expand Down

0 comments on commit c619de0

Please sign in to comment.