Пример #1
0
        public async Task <ITaskRunnerCommandResult> ExecuteCommand(ITaskRunnerCommand command)
        {
            using (var monitor = new TaskRunnerProgressMonitor(outputProgressMonitor)) {
                monitor.Log.WriteLine(command.ToCommandLine());

                var result = Runtime.ProcessService.StartConsoleProcess(
                    command.Executable,
                    command.GetFullArgs(),
                    command.WorkingDirectory,
                    monitor.Console);

                currentOperation = result;

                await result.Task;

                currentOperation = null;

                return(new TaskRunnerCommandResult {
                    StandardOutput = monitor.GetStandardOutputText(),
                    StandardError = monitor.GetStandardErrorText(),
                    ExitCode = result.ExitCode
                });
            }
        }
Пример #2
0
 public static string ToCommandLine(this ITaskRunnerCommand command)
 {
     return($"{command.Executable} {command.GetFullArgs ()}");
 }