(data)
| 164 | } |
| 165 | |
| 166 | private onStderr(data) { |
| 167 | this.sendToConsole(data); // Send it without any processing or buffering |
| 168 | if (this.initResolve) { |
| 169 | if (typeof data === 'string') { this.errBuffer += data; } |
| 170 | else { this.errBuffer += data.toString('utf8'); } |
| 171 | |
| 172 | if (this.initResolve && this.initMatch && this.initMatch.test(this.errBuffer)) { |
| 173 | // console.log(`********* Got initmatch on stderr ${Date.now() - this.startTime}ms`); |
| 174 | this.initResolve(true); |
| 175 | this.initResolve = null; |
| 176 | this.initReject = null; |
| 177 | } |
| 178 | |
| 179 | const end = this.errBuffer.lastIndexOf('\n'); |
| 180 | if (end !== -1) { |
| 181 | // this.emit('output', this.errBuffer.substring(0, end)); |
| 182 | this.errBuffer = this.errBuffer.substring(end + 1); |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | protected connectToConsole(): Promise<void> { |
| 188 | return new Promise<void>((resolve, reject) => { |
nothing calls this directly
no test coverage detected