diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-21 07:26:41 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-21 07:26:41 -0400 |
commit | 35b3b4f4876804fed9542d8d04e93425a96e1fa1 (patch) | |
tree | 45bcac379e22068bc1b8065a6e633e26419bc60d /src/upd8.js | |
parent | 288715112687d33c3193ebae469aaf7d01a52b6d (diff) |
cli, thumbs: factor out stringifyCache
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-x | src/upd8.js | 5 |
1 files changed, 3 insertions, 2 deletions
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`; |