MCPcopy Index your code
hub / github.com/cloudconvert/cloudconvert-cli / createCommandCommand

Function createCommandCommand

src/commands/command.ts:14–36  ·  view source on GitHub ↗
(runJob: JobRunner)

Source from the content-addressed store, hash-verified

12}
13
14export function createCommandCommand(runJob: JobRunner): CommandModule<object, object> {
15 return {
16 command: 'command <files..>',
17 describe: 'Execute custom ffmpeg, imagemagick, or graphicsmagick commands',
18 builder: yargs => buildCommandOptions(yargs),
19 handler: async rawArgv => {
20 const argv = rawArgv as unknown as CommandOperationArguments;
21
22 if ((argv.files ?? []).length < 1) {
23 throw new Error('You need to provide at least one file!');
24 }
25
26 await runJob(argv, {
27 operation: 'command',
28 engine: argv.engine,
29 command: argv.command,
30 arguments: argv.arguments,
31 capture_output: argv.captureOutput,
32 ...collectTaskParameters(argv)
33 });
34 }
35 };
36}
37
38function buildCommandOptions(argv: Argv<object>): Argv<object> {
39 return addTaskParameterMiddleware(

Callers 1

createCliFunction · 0.85

Calls 3

buildCommandOptionsFunction · 0.85
runJobFunction · 0.85
collectTaskParametersFunction · 0.85

Tested by

no test coverage detected