| 102 | }; |
| 103 | |
| 104 | const clearPrevMessage = () => { |
| 105 | if (_prevMessage === undefined) return; |
| 106 | if (isCI) output.write('\n'); |
| 107 | const wrapped = wrapAnsi(_prevMessage, columns, { |
| 108 | hard: true, |
| 109 | trim: false, |
| 110 | }); |
| 111 | const prevLines = wrapped.split('\n'); |
| 112 | if (prevLines.length > 1) { |
| 113 | output.write(cursor.up(prevLines.length - 1)); |
| 114 | } |
| 115 | output.write(cursor.to(0)); |
| 116 | output.write(erase.down()); |
| 117 | }; |
| 118 | |
| 119 | const removeTrailingDots = (msg: string): string => { |
| 120 | return msg.replace(/\.+$/, ''); |