mirror of
https://git.roussel.pro/public-website/singapore_rain_radar.git
synced 2026-02-09 02:20:17 +01:00
refresh file list before removing to attempt to fix #1
This commit is contained in:
@@ -95,6 +95,8 @@ export async function updateImages(count) {
|
||||
}
|
||||
|
||||
//Remove old files
|
||||
files = fs.readdirSync('images/raw');
|
||||
image_count = files.length;
|
||||
for (let file of files.sort().slice(0, image_count - count)) {
|
||||
console.log(`Deleting ${file}`);
|
||||
fs.unlinkSync(`images/raw/${file}`);
|
||||
|
||||
Reference in New Issue
Block a user