public static ScenarioDirectory Create(string scenario) { var name = Path.Combine(rootDirectory, scenario); FileSystem.EnsureDirectoryDeleted(name); FileSystem.EnsureDirectoryCreated(name); return(new ScenarioDirectory(name)); }
private ScriptFile(string scenario, bool createWorkingDirectory) { File.Delete(this.path = Path.Combine(directory, this.name = string.Concat(scenario, ".csx"))); File.Delete(this.log = Path.Combine(directory, string.Concat(scenario, ".log"))); if (createWorkingDirectory) { FileSystem.EnsureDirectoryDeleted(Path.Combine(directory, scenario)); FileSystem.EnsureDirectoryCreated(Path.Combine(directory, scenario)); } }
public ScenarioDirectory WriteLine(string fileName, string text) { fileName = Map(fileName); FileSystem.EnsureDirectoryCreated(Path.GetDirectoryName(fileName)); using (var writer = new StreamWriter(fileName, true)) { writer.WriteLine(text); writer.Flush(); } return(this); }
public static ScenarioDirectory Create(string scenario) { var name = Path.Combine(rootDirectory, scenario); if (name == null) { throw new Exception("Invalid directory"); } Debug.WriteLine($"Scenarios Dir [{name.Length}]: {name}"); FileSystem.EnsureDirectoryDeleted(name); FileSystem.EnsureDirectoryCreated(name); return(new ScenarioDirectory(name)); }
static ScriptFile() { FileSystem.EnsureDirectoryCreated(directory); }