File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -328,22 +328,12 @@ 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 }
344336
345- console . log ( matchingDevices )
346-
347337 // Throw an error if no matching workers are found.
348338 if ( matchingDevices . length === 0 ) {
349339 throw new Error (
You can’t perform that action at this time.
0 commit comments