refresh file list before removing to attempt to fix #1

This commit is contained in:
Quentin Roussel
2024-08-25 14:35:46 +08:00
parent 87360a19c7
commit 2d9d003b79

View File

@@ -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}`);