nested-pipe-verbose.js
This file
Path
test/fixtures/nested-pipe-verbose.js
21 lines · 604 bytes · JavaScript
Last changed by
Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
History of this fileTake it
12345678910111213141516171819202122#!/usr/bin/env nodeimport {execa, getOneMessage, sendMessage} from '../../index.js';import {getNestedOptions} from '../helpers/nested.js';
const { file, commandArguments = [], options: {destinationFile, destinationArguments, ...options}, optionsFixture, optionsInput,} = await getOneMessage();
const commandOptions = await getNestedOptions(options, optionsFixture, optionsInput);
try { const result = await execa(file, commandArguments, commandOptions) .pipe(destinationFile, destinationArguments, commandOptions); await sendMessage(result);} catch (error) { await sendMessage(error);}