File tree Expand file tree Collapse file tree 3 files changed +2037
-9883
lines changed
Expand file tree Collapse file tree 3 files changed +2037
-9883
lines changed Original file line number Diff line number Diff line change 22
33const config = require ( 'wild-config' ) ;
44const log = require ( 'npmlog' ) ;
5- const PluginHandler = require ( 'zone-mta/lib/plugin-handler ' ) ;
5+ const PluginHandler = require ( '@ zone-eu/wild-plugins ' ) ;
66const db = require ( './db' ) ;
77
88module . exports . handler = {
@@ -17,13 +17,20 @@ module.exports.handler = {
1717 }
1818} ;
1919
20- module . exports . init = context => {
20+ module . exports . init = opts => {
21+ let context ;
22+
23+ if ( typeof opts === 'string' ) {
24+ context = opts ;
25+ }
26+ context = opts . context ;
27+
2128 module . exports . handler = new PluginHandler ( {
2229 logger : log ,
23- pluginsPath : config . plugins . pluginsPath ,
24- plugins : config . plugins . conf ,
30+ pluginsPath : opts . config ?. plugins ?. pluginsPath || config . plugins . pluginsPath ,
31+ plugins : opts . config ?. plugins ?. conf || config . plugins . conf ,
2532 context,
26- log : config . log ,
33+ log : opts . config ?. log || config . log ,
2734 db
2835 } ) ;
2936} ;
You can’t perform that action at this time.
0 commit comments