pixelkiln 0.46.0 → 0.46.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/dist/index.js CHANGED
@@ -8720,8 +8720,9 @@ async function fetchAssets(provider, specs, lock, lockPath, opts = {}) {
8720
8720
  const superseded = (entry.supersededOutputs ?? []).find(
8721
8721
  (output, oldIndex, all) => currentOutputPath(output, spec, oldIndex, all.length) === target
8722
8722
  );
8723
+ const outgoing = Boolean(superseded && currentHash === superseded.sha256);
8723
8724
  if (!opts.force) {
8724
- if (superseded && currentHash === superseded.sha256) {
8725
+ if (outgoing) {
8725
8726
  } else if (recorded || superseded) {
8726
8727
  throw new Error(
8727
8728
  `refusing to overwrite modified output ${target}; pass --force to replace it`
@@ -8732,6 +8733,14 @@ async function fetchAssets(provider, specs, lock, lockPath, opts = {}) {
8732
8733
  );
8733
8734
  }
8734
8735
  }
8736
+ if (outgoing && cacheDir) {
8737
+ try {
8738
+ const oldBytes = await readFile11(target);
8739
+ const oldMediaType = detectMediaType(oldBytes);
8740
+ if (oldMediaType) await cacheMedia(cacheDir, oldBytes, oldMediaType, currentHash);
8741
+ } catch {
8742
+ }
8743
+ }
8735
8744
  log(
8736
8745
  ` replace ${path17.relative(process.cwd(), target)}` + (opts.force ? " (--force)" : " (previous tracked generation)")
8737
8746
  );