summaryrefslogtreecommitdiffstats
path: root/editor/editor_paths.cpp
diff options
context:
space:
mode:
authorne0fhyk <fhuyakou@gmail.com>2021-09-10 08:32:29 -0700
committerne0fhyk <fhuyakou@gmail.com>2021-10-11 14:40:14 -0700
commit3e44a6375e775c34898acefd17ffde0116d3b533 (patch)
treed0e162c744845660f3ec9b8334c825841bf279c1 /editor/editor_paths.cpp
parentf930d54140c65cedc1d24b2907f8ae33c39b76f0 (diff)
downloadredot-engine-3e44a6375e775c34898acefd17ffde0116d3b533.tar.gz
Make the project data directory customizable.
Diffstat (limited to 'editor/editor_paths.cpp')
-rw-r--r--editor/editor_paths.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp
index 71f13c0c2f..5b48cc2638 100644
--- a/editor/editor_paths.cpp
+++ b/editor/editor_paths.cpp
@@ -200,6 +200,20 @@ EditorPaths::EditorPaths() {
paths_valid = false;
}
}
+
+ // Check that the project data directory '.gdignore' file exists
+ String project_data_gdignore_file_path = project_data_dir.plus_file(".gdignore");
+ if (!FileAccess::exists(project_data_gdignore_file_path)) {
+ // Add an empty .gdignore file to avoid scan.
+ FileAccessRef f = FileAccess::open(project_data_gdignore_file_path, FileAccess::WRITE);
+ if (f) {
+ f->store_line("");
+ f->close();
+ } else {
+ ERR_PRINT("Failed to create file " + project_data_gdignore_file_path);
+ }
+ }
+
Engine::get_singleton()->set_shader_cache_path(project_data_dir);
// Editor metadata dir.