From 739e8bf783b26da2de0d1eefe04c1047bfe3801f Mon Sep 17 00:00:00 2001 From: ReeZey Date: Mon, 27 Feb 2023 20:10:34 +0100 Subject: [PATCH] v1 --- index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 1690cc5..53541f4 100644 --- a/index.js +++ b/index.js @@ -22,19 +22,19 @@ async function main() { continue; } - let isDir = statSync(input).isDirectory(); + let isDir = statSync(currentArg).isDirectory(); if (isDir) { - for await (let fileName of getFiles(input)) { + for await (let fileName of getFiles(currentArg)) { await convertMedia(fileName); } } else { - await convertMedia(input); + await convertMedia(currentArg); } } - console.log("all done, press any button to exit"); - //setTimeout(() => {}, 5000); - process.stdout.resume(); + console.log("all done"); + setTimeout(() => {}, 5000); + //process.stdin.resume(); } main(); @@ -44,7 +44,7 @@ async function convertMedia(fileName){ let code = await optimiseMedia(fileName); if (code != 0) { console.log("an error occured when reading file, probably ffmpeg doesn't understand format"); - rej(); + return res(); } console.log("done!"); await moveMedia(fileName);