Skip to content

Commit

Permalink
fix: saveImage skipped Items when component version exist
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein committed Oct 17, 2024
1 parent 48e221e commit 51e2423
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,17 @@ class Build {

// Don't download component images or relic images twice
if (isComponent || item.type === 'Relic') {
if (duplicates.includes(item.imageName)) {
if (duplicates.find((i) => i.filePath === filePath)) {
return;
}
duplicates.push(item.imageName);
duplicates.push({ name: item.uniqueName, filePath: filePath });

Check failure on line 242 in build/build.mjs

View workflow job for this annotation

GitHub Actions / Lint

Expected property shorthand
}

// If the component image was downloaded before the item make a copy
const duplicate = duplicates.find((i) => i.name === item.uniqueName);
if (duplicate && duplicate.filePath !== filePath) {
await fs.copyFile(duplicate.filePath, filePath);
return;
}

// Check if the previous image was for a component because they might
Expand Down

0 comments on commit 51e2423

Please sign in to comment.