| 146 | }; |
| 147 | |
| 148 | const handleError = error => { |
| 149 | logUpdate.clear(); |
| 150 | |
| 151 | const message = error.message.trim().replace(/\n +/g, '\n'); |
| 152 | const stack = error.stack.replace(error.message, ''); |
| 153 | |
| 154 | console.log(theme`{error ${message}}\n\n{path ${stack}}`); |
| 155 | process.exit(1); |
| 156 | }; |
| 157 | |
| 158 | const logPromise = async (promise, text, estimate) => |
| 159 | logger(promise, text, {estimate}); |