🌈️ apply a wallpaper based on the weather outside
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(analyze): check whether cache exists before manipulating it

Angel Wang (Jun 23, 2026, 12:05 AM -0600) 33dbc8a1 9df569b2

+7 -6
+7 -6
src/analyze/index.ts
··· 18 18 19 19 console.debug(chalkDebug(`Config: \n${JSON.stringify(config, null, 4)}`)) 20 20 21 - await fs.cp(cachePath, `${cachePath}.bak`, { force: true }, (err: Error) => { 22 - if (err) { 23 - console.log(err) 24 - } 25 - }) 21 + if (fs.statSync(cachePath)) { 22 + await fs.cp(cachePath, `${cachePath}.bak`, { force: true }) 23 + } 24 + 26 25 27 26 const imageData = { files: [] } as ImageAnalysisData 28 27 ··· 30 29 31 30 await analyzeImages(config.imageDir, imageData, cachePath) 32 31 33 - await fs.rm(`${cachePath}.bak`, { force: true }) 32 + if (fs.statSync(`${cachePath}.bak`)) { 33 + await fs.rm(`${cachePath}.bak`, { force: true }) 34 + }