|
|
@ -137,16 +137,11 @@ var fs = require('fs'),
|
|
|
|
|
|
|
|
|
|
|
|
if (data.hook && data.method) {
|
|
|
|
if (data.hook && data.method) {
|
|
|
|
// Assign default priority of 10 if none is passed-in
|
|
|
|
// Assign default priority of 10 if none is passed-in
|
|
|
|
|
|
|
|
data.id = id;
|
|
|
|
if (!data.priority) data.priority = 10;
|
|
|
|
if (!data.priority) data.priority = 10;
|
|
|
|
|
|
|
|
|
|
|
|
_self.loadedHooks[data.hook] = _self.loadedHooks[data.hook] || [];
|
|
|
|
_self.loadedHooks[data.hook] = _self.loadedHooks[data.hook] || [];
|
|
|
|
_self.loadedHooks[data.hook].push({
|
|
|
|
_self.loadedHooks[data.hook].push(data);
|
|
|
|
// [id, data.method, !! data.callbacked, data.priority]
|
|
|
|
|
|
|
|
id: id,
|
|
|
|
|
|
|
|
method: data.method,
|
|
|
|
|
|
|
|
callbacked: data.callbacked,
|
|
|
|
|
|
|
|
priority: data.priority
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (global.env === 'development') winston.info('[plugins] Hook registered: ' + data.hook + ' will call ' + id);
|
|
|
|
if (global.env === 'development') winston.info('[plugins] Hook registered: ' + data.hook + ' will call ' + id);
|
|
|
|
callback();
|
|
|
|
callback();
|
|
|
|