You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.
OS: Linux
cli-ux: 5.4.5
node: v12.16.1
head: head (GNU coreutils) 8.28
When piping the output of cli.table() to head I get Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed.
Error:
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed at Object.Table.options.printLine (~/oclif_bugs/head/node_modules/cli-ux/lib/styled/table.js:39:60) at ~/oclif_bugs/head/node_modules/cli-ux/lib/styled/table.js:257:25 at Array.forEach (<anonymous>) at Table.outputTable (~/oclif_bugs/head/node_modules/cli-ux/lib/styled/table.js:243:27) at Table.display (~/oclif_bugs/head/node_modules/cli-ux/lib/styled/table.js:103:22) at Object.table (~/oclif_bugs/head/node_modules/cli-ux/lib/styled/table.js:263:39) at HeadCommand.run (~/oclif_bugs/head/src/index.js:19:9)
Steps To Reproduce
Create a single oclif app.
Copy / Paste the script below as a command:
const{Command, flags}=require('@oclif/command')constfs=require('fs').promisesconstpath=require('path')constlockfile=require('@yarnpkg/lockfile')const{ cli }=require('cli-ux')constR=require('ramda')classHeadCommandextendsCommand{asyncrun(){const{flags}=this.parse(HeadCommand)constyarnLock=newURL(`file://${path.resolve(__dirname,'..')}/yarn.lock`)constlotOfText=awaitfs.readFile(yarnLock)constdata=lockfile.parse(lotOfText.toString()).objectconstdataList=[]R.forEachObjIndexed((value)=>{dataList.push(R.pick(['version'],value))},data)cli.table(dataList,{version:{}},flags)}}HeadCommand.description=`Describe the command here...Extra documentation goes here`HeadCommand.flags={// add flags from cli.table
...cli.table.flags(),// add --version flag to show CLI versionversion: flags.version({char: 'v'}),// add --help flag to show CLI versionhelp: flags.help({char: 'h'}),}module.exports=HeadCommand
Install: yarn add cli-ux @yarnpkg/lockfile ramda
Run: ./bin/run | head
If you have created a "multi" app, then the path to yarn.lock need to be changed.
The text was updated successfully, but these errors were encountered:
OS: Linux
cli-ux: 5.4.5
node: v12.16.1
head: head (GNU coreutils) 8.28
When piping the output of
cli.table()
tohead
I getError [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
.Error:
Steps To Reproduce
Create a single oclif app.
Copy / Paste the script below as a command:
Install:
yarn add cli-ux @yarnpkg/lockfile ramda
Run:
./bin/run | head
If you have created a "multi" app, then the path to
yarn.lock
need to be changed.The text was updated successfully, but these errors were encountered: