Fix: server.go hangs when typescript finds only one error

Change-Id: I330e6a60036bec97cab688c89cfe0509fbb43ec5
This commit is contained in:
Dmitrii Filippov
2020-07-22 14:37:57 +02:00
parent 2218111624
commit 71b885bb74

View File

@@ -493,7 +493,11 @@ func (_ *server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var (
tsStartingCompilation = "- Starting compilation in watch mode..."
tsFileChangeDetectedMsg = "- File change detected. Starting incremental compilation..."
tsStartWatchingMsg = regexp.MustCompile(`^.* - Found \d+ errors\. Watching for file changes\.$`)
// If there is only one error typescript outputs:
// Found 1 error
// In all other cases it outputs
// Found X errors
tsStartWatchingMsg = regexp.MustCompile(`^.* - Found \d+ error(s)?\. Watching for file changes\.$`)
waitForNextChangeInterval = 1 * time.Second
)