Skip to content

Commit

Permalink
Don't load the hook if it was marked as false
Browse files Browse the repository at this point in the history
Don't load the hook if it was marked as false
  • Loading branch information
luislobo committed Feb 5, 2016
1 parent f4045c2 commit 9850745
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/hooks/moduleloader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ module.exports = function(sails) {
hookName = identity.match(/^sails-hook-/) ? identity.replace(/^sails-hook-/,'') : identity;
}

if (sails.config.hooks[hookName] === false) {
return memo;
}
// Allow overriding core hooks
if (sails.hooks[hookName]) {
sails.log.verbose('Found hook: `'+hookName+'` in `node_modules/`. Overriding core hook w/ the same identity...');
Expand Down

0 comments on commit 9850745

Please sign in to comment.