Create .editorconfig file only on project creation

This commit is contained in:
Haoyu Qiu 2024-09-21 14:50:33 +08:00
parent db66bd35af
commit 8086894a8e
3 changed files with 15 additions and 18 deletions

View file

@ -257,22 +257,6 @@ EditorPaths::EditorPaths() {
}
}
// Check that `.editorconfig` file exists.
String project_editorconfig_path = "res://.editorconfig";
if (!FileAccess::exists(project_editorconfig_path)) {
Ref<FileAccess> f = FileAccess::open(project_editorconfig_path, FileAccess::WRITE);
if (f.is_valid()) {
f->store_line("root = true");
f->store_line("");
f->store_line("[*]");
f->store_line("charset = utf-8");
f->close();
} else {
ERR_PRINT("Failed to create file " + project_editorconfig_path.quote() + ".");
}
FileAccess::set_hidden_attribute(project_editorconfig_path, true);
}
Engine::get_singleton()->set_shader_cache_path(project_data_dir);
// Editor metadata dir.