mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
[CLI] Fix a bug where the default output folder might not exist
This commit is contained in:
parent
28f9744497
commit
000916913e
@ -195,7 +195,7 @@ namespace AssetStudioCLI.Options
|
||||
);
|
||||
o_outputFolder = new GroupedOption<string>
|
||||
(
|
||||
optionDefaultValue: "",
|
||||
optionDefaultValue: "ASExport",
|
||||
optionName: "-o, --output <path>",
|
||||
optionDescription: "Specify path to the output folder\n" +
|
||||
"If path isn't specifyed, 'ASExport' folder will be created in the program's work folder\n",
|
||||
@ -371,7 +371,6 @@ namespace AssetStudioCLI.Options
|
||||
$"Specified file or folder was not found. The input path must be specified as the first argument.");
|
||||
return;
|
||||
}
|
||||
o_outputFolder.Value = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"ASExport{Path.DirectorySeparatorChar}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -774,6 +773,15 @@ namespace AssetStudioCLI.Options
|
||||
{
|
||||
Studio.assemblyLoader.Loaded = true;
|
||||
}
|
||||
if (o_outputFolder.Value == o_outputFolder.DefaultValue)
|
||||
{
|
||||
var fullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, o_outputFolder.DefaultValue + Path.DirectorySeparatorChar);
|
||||
if (!Directory.Exists(fullPath))
|
||||
{
|
||||
Directory.CreateDirectory(fullPath);
|
||||
}
|
||||
o_outputFolder.Value = fullPath;
|
||||
}
|
||||
isParsed = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user