Skip to content

Commit

Permalink
don't use clear line which can throw error on non tty
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrchk committed Jun 1, 2022
1 parent 0abcdbd commit 62935e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@swup/cli",
"description": "Create swup plugins and themes in seconds, or validate your website.",
"version": "4.0.2",
"version": "4.0.3",
"author": {
"name": "Georgy Marchuk",
"email": "[email protected]",
Expand Down
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const normal = require('chalk/source').white
const error = require('chalk/source').red
const info = require('chalk/source').cyan
const success = require('chalk/source').green
const readline = require('readline')

export const syncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
Expand Down Expand Up @@ -62,8 +63,8 @@ export class Log {
}

removeTemporaryLog(text) {
process.stdout.clearLine()
process.stdout.cursorTo(0)
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0, null)
this.log(text)
}
}

0 comments on commit 62935e8

Please sign in to comment.