* Delegates to the `cleanup` method of the wrapped Broccoli builder. * * @private * @method cleanup * @return {Promise}
()
| 213 | * @return {Promise} |
| 214 | */ |
| 215 | async cleanup() { |
| 216 | if (!this._cleanupStarted) { |
| 217 | this._cleanupStarted = true; |
| 218 | let ui = this.project.ui; |
| 219 | ui.startProgress('cleaning up'); |
| 220 | ui.writeLine('cleaning up...'); |
| 221 | |
| 222 | // ensure any addon treeFor caches are reset |
| 223 | _resetTreeCache(); |
| 224 | |
| 225 | this._onProcessInterrupt.removeHandler(this._cleanup); |
| 226 | |
| 227 | let node = heimdall.start({ name: 'Builder Cleanup' }); |
| 228 | try { |
| 229 | await this.builder.cleanup(); |
| 230 | } catch (error) { |
| 231 | ui.writeLine(chalk.red('Cleanup error.')); |
| 232 | ui.writeError(error); |
| 233 | } finally { |
| 234 | ui.stopProgress(); |
| 235 | node.stop(); |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | throwFormattedBroccoliError(err) { |
| 241 | // TODO fix ember-cli/console-ui to handle current broccoli broccoliPayload |
no test coverage detected