mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix writing to folder
Make sure that the folder exists as well as make sure that it has the proper path markings
This commit is contained in:
@@ -50,9 +50,15 @@ namespace SabreTools
|
||||
// Take care of special outfolder cases
|
||||
_outdir = (outdir == "" ? outdir :
|
||||
(outdir.Contains("/") && !outdir.EndsWith("/") ? outdir + "/" :
|
||||
(outdir.Contains("\\") && !outdir.EndsWith("\\") ? outdir + "\\" : outdir)
|
||||
(outdir.Contains("\\") && !outdir.EndsWith("\\") ? outdir + "\\" :
|
||||
(!outdir.Contains("/") && !outdir.Contains("\\") ? outdir + "\\" : outdir)
|
||||
)
|
||||
)
|
||||
);
|
||||
if (!Directory.Exists(_outdir))
|
||||
{
|
||||
Directory.CreateDirectory(_outdir);
|
||||
}
|
||||
|
||||
_headers = new Dictionary<int, string>();
|
||||
_headers.Add(25, "a7800.xml");
|
||||
@@ -74,7 +80,7 @@ namespace SabreTools
|
||||
int id = 0;
|
||||
if (_sources != "" && Int32.TryParse(_sources, out id) && id <= 14)
|
||||
{
|
||||
_logger.Log("This source (" + id + ") is import-only so a DAT cannot be created. We apologize for the inconvenience.");
|
||||
_logger.Warning("This source (" + id + ") is import-only so a DAT cannot be created. We apologize for the inconvenience.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user