Skip to content

Commit

Permalink
refactor(cli): always overwrite atlas file (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric authored Mar 29, 2024
1 parent 1889b31 commit ada12ed
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/utils/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

0 comments on commit ada12ed

Please sign in to comment.