Skip to content

Commit

Permalink
refactor: use console.clear to clear the log (#5700)
Browse files Browse the repository at this point in the history
Co-authored-by: chentao.arthur <chentao.arthur@bytedance.com>
  • Loading branch information
imtaotao and imtaotao committed Jul 24, 2020
1 parent 8f5691b commit 7c2a36b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/@vue/cli-shared-utils/lib/logger.js
@@ -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')
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 7c2a36b

Please sign in to comment.