diff options
Diffstat (limited to 'modules/mono/editor/csharp_project.cpp')
-rw-r--r-- | modules/mono/editor/csharp_project.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/mono/editor/csharp_project.cpp b/modules/mono/editor/csharp_project.cpp index 416108603b..fe79286556 100644 --- a/modules/mono/editor/csharp_project.cpp +++ b/modules/mono/editor/csharp_project.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -158,7 +158,7 @@ Error generate_scripts_metadata(const String &p_project_path, const String &p_ou PoolStringArray project_files = GDMonoMarshal::mono_array_to_PoolStringArray(ret); PoolStringArray::Read r = project_files.read(); - Dictionary old_dict = CSharpLanguage::get_singleton()->get_scripts_metadata(); + Dictionary old_dict = CSharpLanguage::get_singleton()->get_scripts_metadata_or_nothing(); Dictionary new_dict; for (int i = 0; i < project_files.size(); i++) { @@ -228,6 +228,15 @@ Error generate_scripts_metadata(const String &p_project_path, const String &p_ou if (new_dict.size()) { 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; FileAccess *f = FileAccess::open(p_output_path, FileAccess::WRITE, &ferr); ERR_EXPLAIN("Cannot open file for writing: " + p_output_path); |