actions-exec-listener
@actions/exec wrapper to get listener data value as return value.
Usage
const exec = ;// instead of// const exec = require('@actions/exec'); const options = {};optionscwd = './lib';const stdoutStr: myOutput stderrStr: myError = await exec;
Using @actions/exec
const exec = ; let myOutput = '';let myError = ''; const options = {};optionslisteners = { myOutput += data; } { myError += data; };optionscwd = './lib'; await exec;
Above code from actions/toolkit repository
Install
$ npm install actions-exec-listener @actions/exec$ # or $ yarn add actions-exec-listener @actions/exec
Description
It can be used in the same way as @actions/exec
, except for the return value.
Return values
require('actions-exec-listener').exec
returns object containing the below keys.
- Extended from
@actions/exec
stdout
Bufferstderr
Bufferstdline
stringerrline
stringdebug
string
- Added by
actions-exec-listener
stdoutStr
- Returned value of
stdout.toString()
.
- Returned value of
stderrStr
- Returned value of
stderr.toString()
.
- Returned value of
Contribution
PRs are accepted.
If you are having trouble or feature request, post new issue.