protected override ScriptExecution PrepareExecution(Script script, CalamariVariableDictionary variables, Dictionary <string, string> environmentVars = null) { var workingDirectory = Path.GetDirectoryName(script.File); var executable = FSharpBootstrapper.FindExecutable(); var configurationFile = FSharpBootstrapper.PrepareConfigurationFile(workingDirectory, variables); var bootstrapFile = FSharpBootstrapper.PrepareBootstrapFile(script.File, configurationFile, workingDirectory); var arguments = FSharpBootstrapper.FormatCommandArguments(bootstrapFile, script.Parameters); return(new ScriptExecution( new CommandLineInvocation(executable, arguments, workingDirectory, environmentVars), new[] { bootstrapFile, configurationFile } )); }
public CommandResult Execute(Script script, CalamariVariableDictionary variables, ICommandLineRunner commandLineRunner) { var workingDirectory = Path.GetDirectoryName(script.File); var executable = FSharpBootstrapper.FindExecutable(); var configurationFile = FSharpBootstrapper.PrepareConfigurationFile(workingDirectory, variables); var boostrapFile = FSharpBootstrapper.PrepareBootstrapFile(script.File, configurationFile, workingDirectory); var arguments = FSharpBootstrapper.FormatCommandArguments(boostrapFile, script.Parameters); using (new TemporaryFile(configurationFile)) using (new TemporaryFile(boostrapFile)) { return(commandLineRunner.Execute(new CommandLineInvocation(executable, arguments, workingDirectory))); } }
protected override IEnumerable <ScriptExecution> PrepareExecution(Script script, IVariables variables, Dictionary <string, string> environmentVars = null) { var workingDirectory = Path.GetDirectoryName(script.File); var executable = FSharpBootstrapper.FindExecutable(); var configurationFile = FSharpBootstrapper.PrepareConfigurationFile(workingDirectory, variables); var(bootstrapFile, otherTemporaryFiles) = FSharpBootstrapper.PrepareBootstrapFile(script.File, configurationFile, workingDirectory, variables); var arguments = FSharpBootstrapper.FormatCommandArguments(bootstrapFile, script.Parameters); yield return(new ScriptExecution( new CommandLineInvocation(executable, arguments) { WorkingDirectory = workingDirectory, EnvironmentVars = environmentVars }, otherTemporaryFiles.Concat(new[] { bootstrapFile, configurationFile }) )); }