check process.stdout.cursorTo exists

This commit is contained in:
Issue哥 2020-06-30 12:25:14 +08:00
parent 8d17a6b904
commit 00edc1b21b
2 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,7 @@
## 更新日志
[2020-06-30]
- 不换行输出进度信息,优化体验
- 命令行操作时不换行输出进度信息同时将进度信息输出间隔调整为1秒
- 隐藏 timeout exceed 报错信息
## 重要更新2020-06-29

View File

@ -702,8 +702,12 @@ function handle_error (err) {
}
function print_progress (msg) {
if (process.stdout.cursorTo) {
process.stdout.cursorTo(0)
process.stdout.write(msg)
} else {
console.log(msg)
}
}
module.exports = { ls_folder, count, validate_fid, copy, dedupe, copy_file, gen_count_body, real_copy }