mirror of
https://github.com/actions/toolkit
synced 2025-05-10 09:03:02 +00:00
Add getExecOutput function (#814)
* Add getExecOutput function * Add tests for exec output * Modify tests to not rely on buffer size, but only test larger output * Handle split multi-byte characters + PR feedback * Fix tests * Lint * Update how split byte are sent for tests
This commit is contained in:
parent
566ea66979
commit
ddd04b6997
5 changed files with 265 additions and 13 deletions
3
packages/exec/__tests__/scripts/stdoutoutputlarge.js
Normal file
3
packages/exec/__tests__/scripts/stdoutoutputlarge.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
//Default highWaterMark for readable stream buffers us 64K (2^16)
|
||||
//so we go over that to get more than a buffer's worth
|
||||
process.stdout.write('a\n'.repeat(2**24));
|
5
packages/exec/__tests__/scripts/stdoutputspecial.js
Normal file
5
packages/exec/__tests__/scripts/stdoutputspecial.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
//first half of © character
|
||||
process.stdout.write(Buffer.from([0xC2]), (err) => {
|
||||
//write in the callback so that the second byte is sent separately
|
||||
process.stdout.write(Buffer.from([0xA9])) //second half of © character
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue