@@ -19,14 +19,14 @@ const DEFAULT_VERSIONS = {networking: 1};
1919
2020// Helper to get init config
2121const getInitConfig = dirs => _ ( dirs )
22- . filter ( dir => fs . existsSync ( dir ) )
22+ . filter ( dir => typeof dir === 'string' && fs . existsSync ( dir ) )
2323 . flatMap ( dir => globSync ( path . join ( dir , '*' , 'init.js' ) ) . sort ( ) )
2424 . map ( file => require ( file ) )
2525 . value ( ) ;
2626
2727// Helper to get init source config
2828const getInitSourceConfig = dirs => _ ( dirs )
29- . filter ( dir => fs . existsSync ( dir ) )
29+ . filter ( dir => typeof dir === 'string' && fs . existsSync ( dir ) )
3030 . flatMap ( dir => globSync ( path . join ( dir , '*.js' ) ) . sort ( ) )
3131 . map ( file => require ( file ) )
3232 . flatMap ( source => source . sources )
@@ -69,7 +69,7 @@ const bootstrapTasks = lando => {
6969 // Load in all our tasks
7070 return lando . Promise . resolve ( lando . config . plugins )
7171 // Make sure the tasks dir exists
72- . filter ( plugin => fs . existsSync ( plugin . tasks ) )
72+ . filter ( plugin => typeof plugin . tasks === 'string' && fs . existsSync ( plugin . tasks ) )
7373 // Get a list off full js files that exist in that dir
7474 . map ( plugin => _ ( fs . readdirSync ( plugin . tasks ) )
7575 . map ( file => path . join ( plugin . tasks , file ) )
@@ -108,7 +108,7 @@ const bootstrapEngine = lando => {
108108
109109 // Auto move and make executable any scripts
110110 const pluginPromise = lando . Promise . map ( lando . config . plugins , plugin => {
111- if ( fs . existsSync ( plugin . scripts ) ) {
111+ if ( typeof plugin . scripts === 'string' && fs . existsSync ( plugin . scripts ) ) {
112112 const confDir = path . join ( lando . config . userConfRoot , 'scripts' ) ;
113113 const dest = lando . utils . moveConfig ( plugin . scripts , confDir ) ;
114114 lando . utils . makeExecutable ( fs . readdirSync ( dest ) , dest ) ;
@@ -144,7 +144,7 @@ const bootstrapApp = lando => {
144144 // Load in all our builders in the correct order
145145 const builders = _ ( [ 'compose' , 'types' , 'services' , 'recipes' ] )
146146 . flatMap ( type => _ . map ( lando . config . plugins , plugin => plugin [ type ] ) )
147- . filter ( dir => fs . existsSync ( dir ) )
147+ . filter ( dir => typeof dir === 'string' && fs . existsSync ( dir ) )
148148 . flatMap ( dir => globSync ( path . join ( dir , '*' , 'builder.js' ) ) . sort ( ) )
149149 . map ( file => lando . factory . add ( require ( file ) ) . name )
150150 . value ( ) ;
0 commit comments