mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Double path delims aren't needed and can be cleaned
This commit is contained in:
@@ -71,13 +71,17 @@ namespace SabreTools.Helper
|
||||
// Create the output directory if it doesn't already exist
|
||||
Directory.CreateDirectory(outDir);
|
||||
|
||||
// (currently uses current time, change to "last updated time")
|
||||
string extension = (datdata.OutputFormat == OutputFormat.Xml || datdata.OutputFormat == OutputFormat.SabreDat ? ".xml" : ".dat");
|
||||
logger.User("Opening file for writing: " + outDir + datdata.Description + extension);
|
||||
// Get the outfile and clean the path
|
||||
string outfile = outDir + datdata.Description + (datdata.OutputFormat == OutputFormat.Xml || datdata.OutputFormat == OutputFormat.SabreDat ? ".xml" : ".dat");
|
||||
outfile = (outfile.Contains(Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString()) ?
|
||||
outfile.Replace(Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString(), Path.DirectorySeparatorChar.ToString()) :
|
||||
outfile);
|
||||
|
||||
logger.User("Opening file for writing: " + outfile);
|
||||
|
||||
try
|
||||
{
|
||||
FileStream fs = File.Create(outDir + datdata.Description + extension);
|
||||
FileStream fs = File.Create(outfile);
|
||||
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
|
||||
|
||||
string header = "";
|
||||
|
||||
Reference in New Issue
Block a user