@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.cjs
CHANGED
|
@@ -607,23 +607,38 @@ var UploadManager = class {
|
|
|
607
607
|
};
|
|
608
608
|
}
|
|
609
609
|
const files = Array.isArray(filePaths) ? filePaths : [filePaths];
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
const tasks = [];
|
|
611
|
+
validPlatforms.forEach((platform) => {
|
|
612
612
|
const uploader = this.uploaders.get(platform);
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
613
|
+
const matchedFiles = files.filter((f) => uploader.canHandle(f));
|
|
614
|
+
if (matchedFiles.length === 0) {
|
|
615
615
|
logger.warn(`[${platform}] No compatible file found in provided files`);
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
message: `No compatible file found for ${platform}`
|
|
616
|
+
} else {
|
|
617
|
+
matchedFiles.forEach((file) => {
|
|
618
|
+
tasks.push({ platform, file });
|
|
620
619
|
});
|
|
621
620
|
}
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
});
|
|
622
|
+
if (tasks.length === 0) {
|
|
623
|
+
logger.error("No valid platform-file matches found");
|
|
624
|
+
return {
|
|
625
|
+
totalUploads: validPlatforms.length,
|
|
626
|
+
successCount: 0,
|
|
627
|
+
failureCount: validPlatforms.length,
|
|
628
|
+
successPlatforms: [],
|
|
629
|
+
failurePlatforms: validPlatforms,
|
|
630
|
+
results: [],
|
|
631
|
+
totalDurationMs: Date.now() - startTime,
|
|
632
|
+
summary: "No compatible files found for any of the selected platforms"
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
logger.info(`Scheduled ${tasks.length} upload task(s) for ${validPlatforms.length} platform(s)`);
|
|
636
|
+
const uploadPromises = tasks.map((task) => {
|
|
637
|
+
logger.info(`[${task.platform}] Matched file: ${import_path2.default.basename(task.file)}`);
|
|
638
|
+
return this.uploadToPlatform(task.platform, task.file, config, metadata);
|
|
624
639
|
});
|
|
625
640
|
const results = await Promise.all(uploadPromises);
|
|
626
|
-
const report = this.aggregateResults(results,
|
|
641
|
+
const report = this.aggregateResults(results, tasks.length, startTime);
|
|
627
642
|
this.printReport(report);
|
|
628
643
|
return report;
|
|
629
644
|
}
|