[dotnet-watch] Don't show false error messages (#434)

This commit is contained in:
Nate McMaster 2018-05-07 10:52:47 -07:00 committed by GitHub
parent 7cbb6220e4
commit 341ba98d27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
@ -69,13 +69,13 @@ namespace Microsoft.DotNet.Watcher
await Task.WhenAll(processTask, fileSetTask); await Task.WhenAll(processTask, fileSetTask);
if (processTask.Result == 0) if (processTask.Result != 0 && finishedTask == processTask)
{ {
_reporter.Output("Exited"); _reporter.Error($"Exited with error code {processTask.Result}");
} }
else else
{ {
_reporter.Error($"Exited with error code {processTask.Result}"); _reporter.Output("Exited");
} }
if (finishedTask == cancelledTaskSource.Task || cancellationToken.IsCancellationRequested) if (finishedTask == cancelledTaskSource.Task || cancellationToken.IsCancellationRequested)

View File

@ -47,7 +47,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
public async Task HasExited() public async Task HasExited()
{ {
await Process.GetOutputLineAsync(ExitingMessage, DefaultMessageTimeOut); await Process.GetOutputLineAsync(ExitingMessage, DefaultMessageTimeOut);
await Process.GetOutputLineAsync(WatchExitedMessage, DefaultMessageTimeOut); await Process.GetOutputLineStartsWithAsync(WatchExitedMessage, DefaultMessageTimeOut);
} }
public async Task IsWaitingForFileChange() public async Task IsWaitingForFileChange()