Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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());
 }
Ejemplo n.º 5
0
        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));
            }
        }
Ejemplo n.º 6
0
 public CalamariResult(int exitCode, CaptureCommandOutput captured)
 {
     this.exitCode = exitCode;
     this.captured = captured;
 }
Ejemplo n.º 7
0
 public CalamariResult(int exitCode, CaptureCommandOutput captured)
 {
     this.exitCode = exitCode;
     this.captured = captured;
 }