File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -328,20 +328,11 @@ class NonInteractiveState {
328328 } ) ;
329329 } else if ( runConfig . workers instanceof Object ) {
330330 await balenaCloud . authenticate ( runConfig . workers . apiKey ) ;
331- if ( Array . isArray ( runConfig . workers . balenaApplication ) ) {
332- const matchingDevices = runConfig . workers . balenaApplication . map ( async ( ) => {
333- await balenaCloud . selectDevicesWithDUT (
334- runConfig . workers . balenaApplication ,
335- runConfig . deviceType ,
336- )
337- } )
338- } else {
339- const matchingDevices = await balenaCloud . selectDevicesWithDUT (
340- runConfig . workers . balenaApplication ,
341- runConfig . deviceType ,
342- )
331+ let balenaApplications = Array . isArray ( runConfig . workers . balenaApplication ) ? runConfig . workers . balenaApplication : [ runConfig . workers . balenaApplication ] ;
332+ let matchingDevices = [ ]
333+ for ( const balenaApplication of balenaApplications ) {
334+ matchingDevices = [ ...( await balenaCloud . selectDevicesWithDUT ( balenaApplication , runConfig . deviceType ) ) , ...matchingDevices ]
343335 }
344-
345336 console . log ( matchingDevices )
346337
347338 // Throw an error if no matching workers are found.
You can’t perform that action at this time.
0 commit comments