From 671c6b8aa78fca9dd644bb0390309f6e47f50125 Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Tue, 13 Nov 2018 19:22:36 +0000 Subject: [PATCH] Use readline for log util Fixes https://github.com/CookPete/auto-changelog/issues/73 Fixes https://github.com/CookPete/auto-changelog/issues/74 --- src/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index 3fe6cf9d..fef66c54 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,3 +1,4 @@ +import readline from 'readline' import fs from 'fs' import { spawn } from 'child_process' @@ -5,8 +6,8 @@ const MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'Ju export function log (string, clearLine = true) { if (clearLine) { - process.stdout.clearLine() - process.stdout.cursorTo(0) + readline.clearLine(process.stdout) + readline.cursorTo(process.stdout, 0) } process.stdout.write(`auto-changelog: ${string}`) }