From b35eeba94c2650558667f5921b5a4270ee5131fc Mon Sep 17 00:00:00 2001 From: Paul Kinlan Date: Tue, 14 Apr 2020 01:57:55 +0100 Subject: [PATCH] Ensuring that the last parameter is parsed - fixes tests --- src/worker-script/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/worker-script/index.js b/src/worker-script/index.js index 74182db..b94eb59 100644 --- a/src/worker-script/index.js +++ b/src/worker-script/index.js @@ -72,6 +72,10 @@ const parseArgs = (command) => { args.push(arg) } + if (prevDelimiter != command.length) { + args.push(command.substring(prevDelimiter)) + } + return args; } @@ -83,7 +87,7 @@ const run = ({ if (Module === null) { throw NO_LOAD_ERROR; } else { - const args = [...defaultArgs, ...parseArgs(_args))].filter((s) => s.length !== 0); + const args = [...defaultArgs, ...parseArgs(_args)].filter((s) => s.length !== 0); ffmpeg(args.length, strList2ptr(Module, args)); res.resolve({ message: `Complete ${args.join(' ')}`,