UNPKG

@teqed/interact-ibmi

Version:

Menus for interacting with IBMi AS400 using node-odbc.

24 lines (23 loc) 879 B
import chalk from 'chalk'; import executeCommand from '../../util/qcmdexc/execute-command.js'; import { genericGetCommand, genericPressEnterPrompt } from '../generic/generic.js'; export default async function () { const inputCommand = await genericGetCommand({ clearPromptOnDone: false, message: chalk.bgBlue(`\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0Send Command\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0`) + `\nEnter command to send:`, }); const commandExecute = await executeCommand(inputCommand, { pauseOnError: false, throwOnError: false, }); // Console log commandExecute if it's not void. if (commandExecute) { console.log(commandExecute); } else { console.log(` ${chalk.blueBright(`Command failed. See job log for details.`)} `); } return genericPressEnterPrompt(); }