@huoye/app-ship 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/cli.js +26 -11
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +26 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -559,23 +559,38 @@ var UploadManager = class {
|
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
561
|
const files = Array.isArray(filePaths) ? filePaths : [filePaths];
|
|
562
|
-
|
|
563
|
-
|
|
562
|
+
const tasks = [];
|
|
563
|
+
validPlatforms.forEach((platform) => {
|
|
564
564
|
const uploader = this.uploaders.get(platform);
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
565
|
+
const matchedFiles = files.filter((f) => uploader.canHandle(f));
|
|
566
|
+
if (matchedFiles.length === 0) {
|
|
567
567
|
logger.warn(`[${platform}] No compatible file found in provided files`);
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
message: `No compatible file found for ${platform}`
|
|
568
|
+
} else {
|
|
569
|
+
matchedFiles.forEach((file) => {
|
|
570
|
+
tasks.push({ platform, file });
|
|
572
571
|
});
|
|
573
572
|
}
|
|
574
|
-
|
|
575
|
-
|
|
573
|
+
});
|
|
574
|
+
if (tasks.length === 0) {
|
|
575
|
+
logger.error("No valid platform-file matches found");
|
|
576
|
+
return {
|
|
577
|
+
totalUploads: validPlatforms.length,
|
|
578
|
+
successCount: 0,
|
|
579
|
+
failureCount: validPlatforms.length,
|
|
580
|
+
successPlatforms: [],
|
|
581
|
+
failurePlatforms: validPlatforms,
|
|
582
|
+
results: [],
|
|
583
|
+
totalDurationMs: Date.now() - startTime,
|
|
584
|
+
summary: "No compatible files found for any of the selected platforms"
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
logger.info(`Scheduled ${tasks.length} upload task(s) for ${validPlatforms.length} platform(s)`);
|
|
588
|
+
const uploadPromises = tasks.map((task) => {
|
|
589
|
+
logger.info(`[${task.platform}] Matched file: ${path2.basename(task.file)}`);
|
|
590
|
+
return this.uploadToPlatform(task.platform, task.file, config, metadata);
|
|
576
591
|
});
|
|
577
592
|
const results = await Promise.all(uploadPromises);
|
|
578
|
-
const report = this.aggregateResults(results,
|
|
593
|
+
const report = this.aggregateResults(results, tasks.length, startTime);
|
|
579
594
|
this.printReport(report);
|
|
580
595
|
return report;
|
|
581
596
|
}
|