fix: on non tty streams
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
parent
583695828c
commit
3ba5c34afc
|
@ -1,7 +1,11 @@
|
||||||
const progress = (str) => {
|
const progress = (str) => {
|
||||||
process.stdout.clearLine()
|
if (process.stdout.isTTY) {
|
||||||
process.stdout.cursorTo(0)
|
process.stdout.clearLine()
|
||||||
process.stdout.write(str)
|
process.stdout.cursorTo(0)
|
||||||
|
process.stdout.write(str)
|
||||||
|
} else {
|
||||||
|
console.log(str)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const pad = (str, max) => {
|
const pad = (str, max) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user