Skip to content

Commit 8e29923

Browse files
authored
Enhancement: Make dotnet watch do dotnet watch run by default (dotnet#25170)
* Enhancement: Make `dotnet watch` do `dotnet watch run`
1 parent 3d042ac commit 8e29923

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Tools/dotnet-watch/src/Program.cs

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using System.Collections.Generic;
66
using System.IO;
7+
using System.Linq;
78
using System.Threading;
89
using System.Threading.Tasks;
910
using Microsoft.DotNet.Watcher.Internal;
@@ -38,6 +39,11 @@ public static async Task<int> Main(string[] args)
3839
DebugHelper.HandleDebugSwitch(ref args);
3940
using (var program = new Program(PhysicalConsole.Singleton, Directory.GetCurrentDirectory()))
4041
{
42+
//if no command argument provided, we fall back to dotnet watch run
43+
if (args.Length == 0)
44+
{
45+
args = new[] { "run" };
46+
}
4147
return await program.RunAsync(args);
4248
}
4349
}

0 commit comments

Comments
 (0)