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()); }