From 4752e52480c7dcbdc315bf55f28f1ac587d0deb8 Mon Sep 17 00:00:00 2001 From: Wizzard Date: Sat, 17 Aug 2024 15:11:10 -0400 Subject: [PATCH] Delete part files too --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index c0595a0..33ef256 100644 --- a/index.js +++ b/index.js @@ -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')); for (const file of commandFiles) { const command = require(`./commands/${file}`);