@@ -626,8 +626,15 @@ function findOutputFiles(args) {
626626 description = 'PDF';
627627 break;
628628 case 'web':
629- expectedFile = path.join(outputDir, outputName);
630- description = 'web directory';
629+ // Web format can be either a directory or zip file depending on web-zip option
630+ if (args['web-zip']) {
631+ expectedFile = path.join(outputDir, `${outputName}.zip`);
632+ description = 'web ZIP';
633+ }
634+ else {
635+ expectedFile = path.join(outputDir, outputName);
636+ description = 'web directory';
637+ }
631638 break;
632639 case 'ims':
633640 expectedFile = path.join(outputDir, `${outputName}.zip`);
@@ -670,14 +677,27 @@ function findOutputFiles(args) {
670677 }
671678 // Check for the expected file
672679 if (fs.existsSync(expectedFile)) {
673- // For web format, check if it's a directory
680+ // For web format, handle both directory and zip cases
674681 if (args.format === 'web') {
675- if (fs.statSync(expectedFile).isDirectory()) {
676- outputFiles.push(expectedFile);
677- core.info(`Found ${description}: ${expectedFile}`);
682+ if (args['web-zip']) {
683+ // Web ZIP format - expect a file
684+ if (fs.statSync(expectedFile).isFile()) {
685+ outputFiles.push(expectedFile);
686+ core.info(`Found ${description}: ${expectedFile}`);
687+ }
688+ else {
689+ core.warning(`Expected web ZIP file but found directory: ${expectedFile}`);
690+ }
678691 }
679692 else {
680- core.warning(`Expected web directory but found file: ${expectedFile}`);
693+ // Web directory format - expect a directory
694+ if (fs.statSync(expectedFile).isDirectory()) {
695+ outputFiles.push(expectedFile);
696+ core.info(`Found ${description}: ${expectedFile}`);
697+ }
698+ else {
699+ core.warning(`Expected web directory but found file: ${expectedFile}`);
700+ }
681701 }
682702 }
683703 else {
0 commit comments