Skip to content

Commit

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

0 comments on commit 65a8353

Please sign in to comment.