From 07626fe82986214d4ef56a5790d864c4bf19b27e Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 31 May 2017 14:19:47 -0300 Subject: Unlink as well --- play.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/play.js b/play.js index 8833c89..bdee7f4 100644 --- a/play.js +++ b/play.js @@ -75,6 +75,7 @@ const sanitize = require('sanitize-filename') const writeFile = util.promisify(fs.writeFile) const readFile = util.promisify(fs.readFile) +const unlink = util.promisify(fs.unlink) function promisifyProcess(proc, showLogging = true) { return new Promise((resolve, reject) => { @@ -168,7 +169,7 @@ async function loopPlay(fn) { return await downloadNext() } - await fs.unlink('./.temp-track') + await unlink('./.temp-track') return wavFile } @@ -178,7 +179,7 @@ async function loopPlay(fn) { while (wavFile) { const nextPromise = downloadNext() await playFile(wavFile) - await fs.unlink(wavFile) + await unlink(wavFile) wavFile = await nextPromise } } -- cgit 1.3.0-6-gf8a5