private CalamariResult ExecuteScript(IScriptEngine psse, string scriptName, CalamariVariableDictionary variables) { var capture = new CaptureCommandOutput(); var runner = new CommandLineRunner(capture); var result = psse.Execute(scriptName, variables, runner); return new CalamariResult(result.ExitCode, capture); }
protected CalamariResult Invoke(CommandLine command, VariableDictionary variables) { var capture = new CaptureCommandOutput(); var runner = new CommandLineRunner(new SplitCommandOutput(new ConsoleCommandOutput(), new ServiceMessageCommandOutput(variables), capture)); var result = runner.Execute(command.Build()); return new CalamariResult(result.ExitCode, capture); }
protected CalamariResult Invoke(CommandLine command, VariableDictionary variables) { var capture = new CaptureCommandOutput(); var runner = new CommandLineRunner(new SplitCommandOutput(new ConsoleCommandOutput(), new ServiceMessageCommandOutput(variables), capture)); var result = runner.Execute(command.Build()); return new CalamariResult(result.ExitCode, capture); }
public static string ToApprovalString(this CaptureCommandOutput output) { return(output .AllMessages .RemoveIgnoredLines() .TrimRedactedLines() .Aggregate(new StringBuilder(), (builder, s) => builder.AppendLine(s), builder => builder.ToString()) .ScrubGuids() .ScrubTimestampTempFolders()); }
protected CalamariResult InvokeInProcess(CommandLine command, VariableDictionary variables = null) { using (var logs = new ProxyLog()) { var args = command.GetRawArgs(); var container = global::Calamari.Program.BuildContainer(args); var exitCode = container.Resolve <Calamari.Program>().Execute(args); var capture = new CaptureCommandOutput(); var sco = new SplitCommandOutput( new ConsoleCommandOutput(), new ServiceMessageCommandOutput(variables ?? new VariableDictionary()), capture); logs.Flush(sco); return(new CalamariResult(exitCode, capture)); } }
public CalamariResult(int exitCode, CaptureCommandOutput captured) { this.exitCode = exitCode; this.captured = captured; }
public CalamariResult(int exitCode, CaptureCommandOutput captured) { this.exitCode = exitCode; this.captured = captured; }