summaryrefslogtreecommitdiff
path: root/editor/editor_vcs_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_vcs_interface.cpp')
-rw-r--r--editor/editor_vcs_interface.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/editor/editor_vcs_interface.cpp b/editor/editor_vcs_interface.cpp
index eaa8f891ec..b4b740d7c6 100644
--- a/editor/editor_vcs_interface.cpp
+++ b/editor/editor_vcs_interface.cpp
@@ -166,3 +166,24 @@ EditorVCSInterface *EditorVCSInterface::get_singleton() {
void EditorVCSInterface::set_singleton(EditorVCSInterface *p_singleton) {
singleton = p_singleton;
}
+
+void EditorVCSInterface::create_vcs_metadata_files(VCSMetadata p_vcs_metadata_type, String &p_dir) {
+ if (p_vcs_metadata_type == VCSMetadata::GIT) {
+ FileAccess *f = FileAccess::open(p_dir.plus_file(".gitignore"), FileAccess::WRITE);
+ if (!f) {
+ ERR_FAIL_MSG(TTR("Couldn't create .gitignore in project path."));
+ } else {
+ f->store_line("# Godot 4+ specific ignores");
+ f->store_line(".godot/");
+ memdelete(f);
+ }
+ f = FileAccess::open(p_dir.plus_file(".gitattributes"), FileAccess::WRITE);
+ if (!f) {
+ ERR_FAIL_MSG(TTR("Couldn't create .gitattributes in project path."));
+ } else {
+ f->store_line("# Normalize EOL for all files that Git considers text files.");
+ f->store_line("* text=auto eol=lf");
+ memdelete(f);
+ }
+ }
+}