string PerformTest(string sampleFile, VariableDictionary variables) { var temp = Path.GetTempFileName(); using (new TemporaryFile(temp)) { var substituter = new FileSubstituter(); substituter.PerformSubstitution(MapSamplePath(sampleFile), variables, temp); return(File.ReadAllText(temp)); } }
private void SubstituteVariablesInScript(string scriptFileName, CalamariVariableDictionary variables) { if (!File.Exists(scriptFileName)) { throw new CommandException("Could not find script file: " + scriptFileName); } var substituter = new FileSubstituter(CalamariPhysicalFileSystem.GetPhysicalFileSystem()); substituter.PerformSubstitution(scriptFileName, variables); }
private void SubstituteVariablesInScript(CalamariVariableDictionary variables) { if (!substituteVariables) { return; } Log.Info("Substituting variables in: " + scriptFile); var validatedScriptFilePath = AssertScriptFileExists(); var substituter = new FileSubstituter(CalamariPhysicalFileSystem.GetPhysicalFileSystem()); substituter.PerformSubstitution(validatedScriptFilePath, variables); }
dynamic PerformTest(string sampleFile, VariableDictionary variables) { var temp = Path.GetTempFileName(); using (new TemporaryFile(temp)) { var substituter = new FileSubstituter(FileSystem); substituter.PerformSubstitution(sampleFile, variables, temp); return(new { Text = FileSystem.ReadFile(temp), Encoding = FileSystem.GetFileEncoding(temp) }); } }
private void SubstituteVariablesInScript(CalamariVariableDictionary variables) { if (!substituteVariables) { return; } Log.Info("Substituting variables in: " + scriptFile); var validatedScriptFilePath = AssertScriptFileExists(); var substituter = new FileSubstituter(CalamariPhysicalFileSystem.GetPhysicalFileSystem()); substituter.PerformSubstitution(validatedScriptFilePath, variables); // Replace variables on any other files that may have been extracted with the package new SubstituteInFilesConvention(CalamariPhysicalFileSystem.GetPhysicalFileSystem(), substituter) .Install(deployment); }