Fix C# script metadata creation error due to missing directory
This commit is contained in:
parent
ca8100f29f
commit
0ac5be8368
1 changed files with 9 additions and 0 deletions
|
@ -228,6 +228,15 @@ Error generate_scripts_metadata(const String &p_project_path, const String &p_ou
|
||||||
if (new_dict.size()) {
|
if (new_dict.size()) {
|
||||||
String json = JSON::print(new_dict, "", false);
|
String json = JSON::print(new_dict, "", false);
|
||||||
|
|
||||||
|
String base_dir = p_output_path.get_base_dir();
|
||||||
|
|
||||||
|
if (!DirAccess::exists(base_dir)) {
|
||||||
|
DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||||
|
|
||||||
|
Error err = da->make_dir_recursive(base_dir);
|
||||||
|
ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
|
||||||
|
}
|
||||||
|
|
||||||
Error ferr;
|
Error ferr;
|
||||||
FileAccess *f = FileAccess::open(p_output_path, FileAccess::WRITE, &ferr);
|
FileAccess *f = FileAccess::open(p_output_path, FileAccess::WRITE, &ferr);
|
||||||
ERR_EXPLAIN("Cannot open file for writing: " + p_output_path);
|
ERR_EXPLAIN("Cannot open file for writing: " + p_output_path);
|
||||||
|
|
Loading…
Reference in a new issue