summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-08 10:50:46 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-08 10:50:46 +0100
commit40ed34f6dc1422fb440d60306afb9778f7a7d07b (patch)
tree08328fe58e5ae294c19c4bf5360ea63e51c6e2b3 /core
parent70bde0d762179e81fba8e86720154a55c551881b (diff)
parent669888b9cfa7458be025dacf1a34d0eaf791ae81 (diff)
Merge pull request #68373 from akien-mga/extension-api-json-newline-eof
GDExtension: Ensure newline at EOF
Diffstat (limited to 'core')
-rw-r--r--core/extension/extension_api_dump.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp
index 96b396caa9..a2c507e350 100644
--- a/core/extension/extension_api_dump.cpp
+++ b/core/extension/extension_api_dump.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "extension_api_dump.h"
+
#include "core/config/engine.h"
#include "core/core_constants.h"
#include "core/io/file_access.h"
@@ -938,9 +939,9 @@ void NativeExtensionAPIDump::generate_extension_json_file(const String &p_path)
Ref<JSON> json;
json.instantiate();
- String text = json->stringify(api, "\t", false);
+ String text = json->stringify(api, "\t", false) + "\n";
Ref<FileAccess> fa = FileAccess::open(p_path, FileAccess::WRITE);
- CharString cs = text.ascii();
- fa->store_buffer((const uint8_t *)cs.ptr(), cs.length());
+ fa->store_string(text);
}
-#endif
+
+#endif // TOOLS_ENABLED