Skip to content
Snippets Groups Projects
Commit 7c80a97d authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Don't fail when simulations_budget/index.json doesn't exist

parent b1753dfe
No related branches found
No related tags found
No related merge requests found
Pipeline #11367 passed
......@@ -7,6 +7,7 @@ const { simulationsBudgetDir } = config
// Remove private budget simulations from index.
const indexFilePath = path.join(simulationsBudgetDir, "index.json")
if (fs.pathExistsSync(indexFilePath)) {
const publicSimulationsSummary = (
fs.readJsonSync(indexFilePath) as Array<{ public: boolean }>
).filter((summary) => summary.public)
......@@ -14,6 +15,7 @@ fs.writeJsonSync(indexFilePath, publicSimulationsSummary, {
encoding: "utf-8",
spaces: 2,
})
}
// Remove every budget simulations from cache.
for (const dirName of await fs.readdir(simulationsBudgetDir)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment