File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ function check(name) {
1212 try {
1313 return req . resolve ( name ) ;
1414 } catch ( e ) {
15+ debug ( 'ezs:warn' ) ( `req.resolve failed with '${ name } '` ) ;
1516 return null ;
1617 }
1718}
@@ -31,6 +32,7 @@ export function useFile(ezs, name) {
3132 'ezs-' . concat ( String ( name ) . replace ( / ^ e z s - / , '' ) ) ,
3233 '@ezs/' . concat ( String ( bname ) . replace ( / ^ @ e z s \/ / , '' ) ) ,
3334 'ezs-' . concat ( String ( bname ) . replace ( / ^ e z s - / , '' ) ) ,
35+ String ( bname ) . concat ( '/src/' ) ,
3436 ] ;
3537 const plugName1 = names . map ( ( n ) => check ( n ) ) . filter ( Boolean ) . shift ( ) ;
3638 const plugName2 = names . map ( ( n ) => findFileIn ( ezs . getPath ( ) , n ) ) . filter ( Boolean ) . shift ( ) ;
Original file line number Diff line number Diff line change 11import { PassThrough } from 'readable-stream' ;
22import debug from 'debug' ;
3+ import uniq from 'lodash/uniq' ;
34import writeTo from 'stream-write' ;
45import LRU from 'lru-cache' ;
56import Engine from './engine.js' ;
@@ -76,7 +77,7 @@ ezs.useFiles = (files) => {
7677 return Statement . list ( ) ;
7778} ;
7879ezs . addPath = ( p ) => ezs . settings . pluginPaths . push ( p ) ;
79- ezs . getPath = ( ) => ezs . settings . pluginPaths ;
80+ ezs . getPath = ( ) => uniq ( ezs . settings . pluginPaths ) ;
8081ezs . getCache = ( ) => ezsCache ;
8182ezs . loadScript = ( file ) => File ( ezs , file ) ;
8283ezs . compileScript = ( script ) => new Commands ( ezs . parseString ( script ) ) ;
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ const continueDelay = Number(process.env.EZS_CONTINUE_DELAY || 5);
1818const pipelineDelay = Number ( process . env . EZS_PIPELINE_DELAY || 300 ) ;
1919const [ , dirname ] = filedirname ( ) ;
2020const pluginPaths = [
21- resolve ( dirname , '../..' ) ,
22- resolve ( dirname , '../../node_modules' ) ,
23- process . cwd ( ) ,
21+ resolve ( dirname , '../..' ) ,
22+ resolve ( dirname , '../../node_modules' ) ,
23+ process . cwd ( ) ,
2424 resolve ( process . cwd ( ) , './node_modules' ) ,
2525 globalModules
2626] ;
You can’t perform that action at this time.
0 commit comments