Skip to content

Commit

Permalink
fix(packages/core): add missing readline dependence
Browse files Browse the repository at this point in the history
Fixes #4836
  • Loading branch information
starpit committed Jun 6, 2020
1 parent 948d12c commit 6440f0e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"needle": "2.4.0",
"pretty-ms": "5.1.0",
"properties-parser": "0.3.1",
"readline": "^1.3.0",
"tmp": "0.1.0",
"uuid": "7.0.2",
"yargs-parser": "18.1.3"
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/main/headless-support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Debug from 'debug'
const debug = Debug('core/main/headless-support')
debug('loading')

import { clearLine, cursorTo } from 'readline'
import { Streamable } from '../models/streamable'

/**
Expand All @@ -29,7 +28,10 @@ import { Streamable } from '../models/streamable'
*
*/
export const streamTo = async () => {
const { print } = await import('./headless-pretty-print')
const [{ clearLine, cursorTo }, { print }] = await Promise.all([
import('readline'),
import('./headless-pretty-print')
])

return (response: Streamable, killLine?: boolean) => {
debug('streaming response', killLine)
Expand Down

0 comments on commit 6440f0e

Please sign in to comment.