Prune blank args

This commit is contained in:
HaveAGitGat 2023-10-11 07:25:14 +01:00
parent 9e0812b143
commit d9d03b9517
4 changed files with 14 additions and 9 deletions

View file

@ -141,20 +141,22 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
cliArgs.push(outputFilePath);
const spawnArgs = cliArgs.map((row) => row.trim()).filter((row) => row !== '');
args.jobLog('Processing file');
args.jobLog(JSON.stringify({
cliArgs,
spawnArgs,
outputFilePath,
}));
args.updateWorker({
CLIType: args.ffmpegPath,
preset: cliArgs.join(' '),
preset: spawnArgs.join(' '),
});
const cli = new CLI({
cli: args.ffmpegPath,
spawnArgs: cliArgs,
spawnArgs,
spawnOpts: {},
jobLog: args.jobLog,
outputFilePath,

View file

@ -244,7 +244,8 @@ class CLI {
const cliExitCode: number = await new Promise((resolve) => {
try {
const opts = this.config.spawnOpts || {};
const thread = childProcess.spawn(this.config.cli, this.config.spawnArgs, opts);
const spawnArgs = this.config.spawnArgs.map((row) => row.trim()).filter((row) => row !== '');
const thread = childProcess.spawn(this.config.cli, spawnArgs, opts);
thread.stdout.on('data', (data: string) => {
// eslint-disable-next-line no-console