From 35b3b4f4876804fed9542d8d04e93425a96e1fa1 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 21 Jan 2025 07:26:41 -0400 Subject: cli, thumbs: factor out stringifyCache --- src/upd8.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/upd8.js') diff --git a/src/upd8.js b/src/upd8.js index 3628bff5..306715dd 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -42,6 +42,7 @@ import wrap from 'word-wrap'; import {mapAggregate, openAggregate, showAggregate} from '#aggregate'; import CacheableObject from '#cacheable-object'; +import {stringifyCache} from '#cli'; import {displayCompositeCacheAnalysis} from '#composite'; import find, {bindFind, getAllFindSpecs} from '#find'; import {processLanguageFile, watchLanguageFile, internalDefaultStringsFile} @@ -2076,7 +2077,7 @@ async function main() { } try { - await writeFile(cacheFile, JSON.stringify(onlineThumbsCache ?? {})); + await writeFile(cacheFile, stringifyCache(onlineThumbsCache)); } catch (caughtError) { writeError = caughtError; } @@ -2133,7 +2134,7 @@ async function main() { if (onlineThumbsCache && !writeError) { try { - await writeFile(cacheFile, JSON.stringify(onlineThumbsCache)); + await writeFile(cacheFile, stringifyCache(onlineThumbsCache)); } catch (error) { console.error(error); logWarn`There was an error saving a local copy of the`; -- cgit 1.3.0-6-gf8a5