From 4b138c8aabd320414fdc7706a894f8346acb8a78 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Fri, 29 Mar 2024 14:58:06 +0100 Subject: [PATCH] refactor(cli): always overwrite atlas file --- src/utils/stats.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/utils/stats.ts b/src/utils/stats.ts index 4a2c571..fd746f6 100644 --- a/src/utils/stats.ts +++ b/src/utils/stats.ts @@ -40,14 +40,7 @@ export async function validateStatsFile(statsFile: string, metadata = getStatsMe * This metdata is used by the API to determine version compatibility. */ export async function createStatsFile(filePath: string) { - if (fs.existsSync(filePath)) { - try { - return await validateStatsFile(filePath); - } catch { - await fs.promises.writeFile(filePath, ''); - } - } - await fs.promises.mkdir(path.dirname(filePath), { recursive: true }); + await fs.promises.rm(filePath, { force: true }); await appendJsonLine(filePath, getStatsMetdata()); }