コード例 #1
0
    static async Task Run(Microsoft.DotNet.HotReload.Utils.Generator.Config config)
    {
        var runner = Microsoft.DotNet.HotReload.Utils.Generator.Runner.Make(config);
        await runner.Run();

        Console.WriteLine("done");
    }
コード例 #2
0
    static async Task <int> RunWithExitStatus(Microsoft.DotNet.HotReload.Utils.Generator.Config config)
    {
        try {
            await Run(config);

            return(0);
        } catch (Microsoft.DotNet.HotReload.Utils.Generator.DiffyException exn) {
            Console.Error.WriteLine($"Error: {exn.Message}");
            if (exn.ExitStatus == 0)
            {
                return(1); /* really shouldn't happen, but just in case */
            }
            return(exn.ExitStatus);
        }
    }