(argv: ArgumentsCamelCase<CommandArgs>)
| 44 | .epilog(buildEpilog({ command, apiDocs: ['executeDeviceCommands'] })) |
| 45 | |
| 46 | const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => { |
| 47 | const command = await apiCommand(argv) |
| 48 | |
| 49 | const deviceId = await chooseDevice(command, argv.id) |
| 50 | |
| 51 | const [commands] = await inputItem<Command>( |
| 52 | argv, |
| 53 | commandLineInputProcessor({ |
| 54 | hasCommandLineInput: () => !!argv.command, |
| 55 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion |
| 56 | getInputFromCommandLine: async () => parseDeviceCommand(argv.command!), |
| 57 | }), |
| 58 | userInputProcessor(() => getInputFromUser(command, deviceId)), |
| 59 | ) |
| 60 | |
| 61 | await command.client.devices.executeCommands(deviceId, [commands]) |
| 62 | console.log('Command executed successfully') |
| 63 | } |
| 64 | |
| 65 | const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler } |
| 66 | export default cmd |
nothing calls this directly
no test coverage detected