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
|
// Take care of special outfolder cases
|
||||||
_outdir = (outdir == "" ? outdir :
|
_outdir = (outdir == "" ? outdir :
|
||||||
(outdir.Contains("/") && !outdir.EndsWith("/") ? 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 = new Dictionary<int, string>();
|
||||||
_headers.Add(25, "a7800.xml");
|
_headers.Add(25, "a7800.xml");
|
||||||
@@ -74,7 +80,7 @@ namespace SabreTools
|
|||||||
int id = 0;
|
int id = 0;
|
||||||
if (_sources != "" && Int32.TryParse(_sources, out id) && id <= 14)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ Make a selection:
|
|||||||
|
|
||||||
1) " + (norename ? "Enable game renaming" : "Disable game renaming") + @"
|
1) " + (norename ? "Enable game renaming" : "Disable game renaming") + @"
|
||||||
2) " + (old ? "Enable XML output" : "Enable RomVault output") + @"
|
2) " + (old ? "Enable XML output" : "Enable RomVault output") + @"
|
||||||
3) Enter an output folder
|
3) Enter an output folder
|
||||||
4) Generate all DAT files
|
4) Generate all DAT files
|
||||||
B) Go back to the previous menu
|
B) Go back to the previous menu
|
||||||
");
|
");
|
||||||
|
|||||||
Reference in New Issue
Block a user