You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Make --doctool create directories if they don't exist
This prevents errors due to missing directories when generating engine documentation. This closes #17297.
This commit is contained in:
@@ -1374,7 +1374,7 @@ bool Main::start() {
|
|||||||
{
|
{
|
||||||
DirAccessRef da = DirAccess::open(doc_tool);
|
DirAccessRef da = DirAccess::open(doc_tool);
|
||||||
if (!da) {
|
if (!da) {
|
||||||
ERR_EXPLAIN("Argument supplied to --doctool must be a base godot build directory");
|
ERR_EXPLAIN("Argument supplied to --doctool must be a base Godot build directory");
|
||||||
ERR_FAIL_V(false);
|
ERR_FAIL_V(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1392,12 +1392,23 @@ bool Main::start() {
|
|||||||
doc_data_classes[name] = path;
|
doc_data_classes[name] = path;
|
||||||
if (!checked_paths.has(path)) {
|
if (!checked_paths.has(path)) {
|
||||||
checked_paths.insert(path);
|
checked_paths.insert(path);
|
||||||
|
|
||||||
|
// Create the module documentation directory if it doesn't exist
|
||||||
|
DirAccess *da = DirAccess::create_for_path(path);
|
||||||
|
da->make_dir_recursive(path);
|
||||||
|
memdelete(da);
|
||||||
|
|
||||||
docsrc.load_classes(path);
|
docsrc.load_classes(path);
|
||||||
print_line("Loading docs from: " + path);
|
print_line("Loading docs from: " + path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String index_path = doc_tool.plus_file("doc/classes");
|
String index_path = doc_tool.plus_file("doc/classes");
|
||||||
|
// Create the main documentation directory if it doesn't exist
|
||||||
|
DirAccess *da = DirAccess::create_for_path(index_path);
|
||||||
|
da->make_dir_recursive(index_path);
|
||||||
|
memdelete(da);
|
||||||
|
|
||||||
docsrc.load_classes(index_path);
|
docsrc.load_classes(index_path);
|
||||||
checked_paths.insert(index_path);
|
checked_paths.insert(index_path);
|
||||||
print_line("Loading docs from: " + index_path);
|
print_line("Loading docs from: " + index_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user