mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-28 18:32:50 +00:00
Create all directories for the specified JSON file when exporting sprite sheets
This commit is contained in:
parent
9e47b07219
commit
9257b9e244
@ -408,6 +408,20 @@ Doc* DocExporter::exportSheet(Context* ctx)
|
||||
osbuf = std::cout.rdbuf();
|
||||
}
|
||||
else {
|
||||
// Make missing directories for the json file
|
||||
{
|
||||
std::string dir = base::get_file_path(m_dataFilename);
|
||||
try {
|
||||
if (!base::is_directory(dir))
|
||||
base::make_all_directories(dir);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
Console console;
|
||||
console.printf("Error creating directory \"%s\"\n%s",
|
||||
dir.c_str(), ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
fos.open(FSTREAM_PATH(m_dataFilename), std::ios::out);
|
||||
osbuf = fos.rdbuf();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user