mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-30 16:59:31 -05:00
refactor: use console.clear to clear the log (#5700)
Co-authored-by: chentao.arthur <chentao.arthur@bytedance.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const chalk = require('chalk')
|
||||
const stripAnsi = require('strip-ansi')
|
||||
const readline = require('readline')
|
||||
const EventEmitter = require('events')
|
||||
|
||||
const { stopSpinner } = require('./spinner')
|
||||
@@ -59,10 +58,7 @@ exports.error = (msg, tag = null) => {
|
||||
|
||||
exports.clearConsole = title => {
|
||||
if (process.stdout.isTTY) {
|
||||
const blank = '\n'.repeat(process.stdout.rows)
|
||||
console.log(blank)
|
||||
readline.cursorTo(process.stdout, 0, 0)
|
||||
readline.clearScreenDown(process.stdout)
|
||||
console.clear()
|
||||
if (title) {
|
||||
console.log(title)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user