fix: ensure Scryfall set cache directory exists and update service worker revision for index.html.
All checks were successful
Build and Deploy / build (push) Successful in 2m3s

This commit is contained in:
2025-12-22 10:46:39 +01:00
parent c9d0230781
commit fd7642dded
2 changed files with 4 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ define(['./workbox-5a5d9309'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
"revision": "0.g6k3e4tvo1g"
"revision": "0.lnjaj3n52vg"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View File

@@ -267,6 +267,9 @@ export class ScryfallService {
// Save Set Cache
if (allCards.length > 0) {
if (!fs.existsSync(path.dirname(setCachePath))) {
fs.mkdirSync(path.dirname(setCachePath), { recursive: true });
}
fs.writeFileSync(setCachePath, JSON.stringify(allCards, null, 2));
// Smartly save individuals: only if missing from cache