mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[windows:ci] handle CLI output in a cross-compat way (#2801)
* handle readline in a cross-compat way * Create modern-feet-lay.md
This commit is contained in:
parent
fc50fbb47a
commit
11fb3745dd
2 changed files with 9 additions and 3 deletions
5
.changeset/modern-feet-lay.md
Normal file
5
.changeset/modern-feet-lay.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Fix: Handle CLI output in a cross-compat way
|
|
@ -4,6 +4,7 @@ import { bold, cyan, dim, red, grey, underline, yellow, reset } from 'kleur/colo
|
|||
import { performance } from 'perf_hooks';
|
||||
import { Writable } from 'stream';
|
||||
import stringWidth from 'string-width';
|
||||
import * as readline from 'readline';
|
||||
import debugPackage from 'debug';
|
||||
import { format as utilFormat } from 'util';
|
||||
|
||||
|
@ -69,9 +70,9 @@ export const defaultLogDestination = new Writable({
|
|||
lines = Math.ceil(len / cols);
|
||||
}
|
||||
for (let i = 0; i < lines; i++) {
|
||||
(dest as typeof process.stdout).clearLine(0);
|
||||
(dest as typeof process.stdout).cursorTo(0);
|
||||
(dest as typeof process.stdout).moveCursor(0, -1);
|
||||
readline.clearLine(dest, 0);
|
||||
readline.cursorTo(dest, 0);
|
||||
readline.moveCursor(dest, 0, -1);
|
||||
}
|
||||
}
|
||||
message = `${message} ${yellow(`(x${lastMessageCount})`)}`;
|
||||
|
|
Loading…
Reference in a new issue