From 65a8353dd696932988c0cafc045d7a5f092ab265 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 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/utils/stats.ts b/src/utils/stats.ts index 4a2c571..12640f5 100644 --- a/src/utils/stats.ts +++ b/src/utils/stats.ts @@ -37,17 +37,9 @@ export async function validateStatsFile(statsFile: string, metadata = getStatsMe /** * Create or overwrite the stats file with basic metadata. - * 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()); }