@@ -324,17 +324,53 @@ function fillTextareaWithAWSResubmitCommands() {
324324 return ;
325325 }
326326
327- hideModalWarning ( ) ;
328- const folderNames = Array . from ( selectedCheckboxes ) . map ( ( checkbox ) => {
327+ // Get the row for each checkbox and extract AWS command from metadata
328+ const commandsWithInfo = Array . from ( selectedCheckboxes ) . map ( ( checkbox ) => {
329+ const row = checkbox . closest ( ".game-row" ) ;
330+ const awsCommand = row ? row . getAttribute ( "data-aws-command" ) : "" ;
329331 const fullPath = checkbox . getAttribute ( "data-path" ) ;
330- return fullPath . split ( "/" ) . pop ( ) ;
332+
333+ return {
334+ path : fullPath ,
335+ awsCommand : awsCommand ,
336+ hasCommand : awsCommand && awsCommand . trim ( ) !== "" ,
337+ } ;
331338 } ) ;
332339
333- const commands = folderNames . map ( ( folderName ) => {
334- return `aws/run_job.py -- main.py --config-file configs/main/${ folderName } .yaml` ;
340+ // Separate folders with and without AWS commands
341+ const foldersWithCommands = commandsWithInfo . filter (
342+ ( info ) => info . hasCommand ,
343+ ) ;
344+ const foldersWithoutCommands = commandsWithInfo . filter (
345+ ( info ) => ! info . hasCommand ,
346+ ) ;
347+
348+ if ( foldersWithCommands . length === 0 ) {
349+ showModalWarning (
350+ "None of the selected folders have AWS command information in their metadata." ,
351+ ) ;
352+ document . getElementById ( "bulk-actions-textarea" ) . value = "" ;
353+ return ;
354+ }
355+
356+ // Generate commands for folders that have AWS command info
357+ const commands = foldersWithCommands . map ( ( info ) => {
358+ return `aws/run_job.py -- ${ info . awsCommand } ` ;
335359 } ) ;
336360
337361 document . getElementById ( "bulk-actions-textarea" ) . value = commands . join ( "\n" ) ;
362+
363+ // Show warning if some folders are missing AWS commands
364+ if ( foldersWithoutCommands . length > 0 ) {
365+ const folderNames = foldersWithoutCommands
366+ . map ( ( info ) => info . path . split ( "/" ) . pop ( ) )
367+ . join ( ", " ) ;
368+ showModalWarning (
369+ `Warning: ${ foldersWithoutCommands . length } folder(s) skipped due to missing AWS command in metadata: ${ folderNames } ` ,
370+ ) ;
371+ } else {
372+ hideModalWarning ( ) ;
373+ }
338374}
339375
340376function copyFromModal ( ) {
0 commit comments