Delete part files too

This commit is contained in:
Wizzard 2024-08-17 15:11:10 -04:00
parent a25d1202b1
commit 4752e52480
1 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,18 @@ fs.readdir(tmpDir, (err, files) => {
} }
}); });
fs.readdir(tmpDir, (err, files) => {
if (err) throw err;
for (const file of files) {
if (file.endsWith('.part')) {
fs.unlink(path.join(tmpDir, file), err => {
if (err) throw err;
});
}
}
});
const commandFiles = fs.readdirSync(path.join(__dirname, 'commands')).filter(file => file.endsWith('.js')); const commandFiles = fs.readdirSync(path.join(__dirname, 'commands')).filter(file => file.endsWith('.js'));
for (const file of commandFiles) { for (const file of commandFiles) {
const command = require(`./commands/${file}`); const command = require(`./commands/${file}`);