diff options
author | ne0fhyk <fhuyakou@gmail.com> | 2021-10-13 13:56:18 -0700 |
---|---|---|
committer | ne0fhyk <fhuyakou@gmail.com> | 2021-10-18 14:10:38 -0700 |
commit | b5c750fa65af018eabd339d63666316b9ca4a2d4 (patch) | |
tree | 0efaeb97caf0cbdf9b79861c115cb37eba43a588 /modules/mono/editor/GodotTools | |
parent | f4d9749e230130fd9b462c8eb745b6d01a3accf1 (diff) |
Restrict the project data directory configuration
Diffstat (limited to 'modules/mono/editor/GodotTools')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs index 1d7bfaf0a4..bc09e1ebf9 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs @@ -121,15 +121,20 @@ namespace GodotTools.IdeMessaging this.messageHandler = messageHandler; this.logger = logger; - // TODO: Need to fetch the project data dir name from ProjectSettings instead of defaulting to ".godot" string projectMetadataDir = Path.Combine(godotProjectDir, ".godot", "mono", "metadata"); + // FileSystemWatcher requires an existing directory + if (!Directory.Exists(projectMetadataDir)) { + // Check if the non hidden version exists + string nonHiddenProjectMetadataDir = Path.Combine(godotProjectDir, "godot", "mono", "metadata"); + if (Directory.Exists(nonHiddenProjectMetadataDir)) { + projectMetadataDir = nonHiddenProjectMetadataDir; + } else { + Directory.CreateDirectory(projectMetadataDir); + } + } MetaFilePath = Path.Combine(projectMetadataDir, GodotIdeMetadata.DefaultFileName); - // FileSystemWatcher requires an existing directory - if (!Directory.Exists(projectMetadataDir)) - Directory.CreateDirectory(projectMetadataDir); - fsWatcher = new FileSystemWatcher(projectMetadataDir, GodotIdeMetadata.DefaultFileName); } |