From 9f41325df09ea9432497ea4a5c83df92a98c20d8 Mon Sep 17 00:00:00 2001 From: Jack Jordan Date: Mon, 22 Jul 2024 14:55:28 +1000 Subject: [PATCH 1/2] Move .plugged to addons/gd-plug/.plugged Moving the dir here stops gdscript warnings from triggering on addon code. The Godot team have indicated that they will only support disabling warnings in this directory as it is the only place third party code should be placed. --- README.md | 1 - addons/gd-plug/plug.gd | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 28598d0..b9341b5 100644 --- a/README.md +++ b/README.md @@ -255,7 +255,6 @@ func _on_plugin_updated(plugin): ## Known Limitations -- Godot always show errors from plugin repositories in `./plugged` even with `.gdignore` (See [#32](https://github.com/imjp94/gd-plug/issues/32)) - Sometimes random .import files will be unable to remove, while the reason behind it still remains unknown. - Workaround: Read output for those .import files that failed to remove, and manually delete them. - `autoload` script references in project setting are not cleared as plugin uninstalled. diff --git a/addons/gd-plug/plug.gd b/addons/gd-plug/plug.gd index 8b20175..7d66724 100644 --- a/addons/gd-plug/plug.gd +++ b/addons/gd-plug/plug.gd @@ -5,7 +5,7 @@ signal updated(plugin) const VERSION = "0.2.6" const DEFAULT_PLUGIN_URL = "https://git::@github.com/%s.git" -const DEFAULT_PLUG_DIR = "res://.plugged" +const DEFAULT_PLUG_DIR = "res://addons/gd-plug/.plugged" const DEFAULT_CONFIG_PATH = DEFAULT_PLUG_DIR + "/index.cfg" const DEFAULT_USER_PLUG_SCRIPT_PATH = "res://plug.gd" const DEFAULT_BASE_PLUG_SCRIPT_PATH = "res://addons/gd-plug/plug.gd" From b45809a462654dd51e05b39aa51e13523847c1cc Mon Sep 17 00:00:00 2001 From: Jack Jordan Date: Mon, 5 Aug 2024 13:26:04 +1000 Subject: [PATCH 2/2] Fix include / exclude options. These options should apply to the path within the source directory, not the local project's path after copying them to .plugged. --- addons/gd-plug/plug.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/gd-plug/plug.gd b/addons/gd-plug/plug.gd index 7d66724..cdcc31b 100644 --- a/addons/gd-plug/plug.gd +++ b/addons/gd-plug/plug.gd @@ -594,10 +594,12 @@ func directory_copy_recursively(from, to, args={}): dest_files += directory_copy_recursively(source, dest, args) else: for include_key in include: - if include_key in source: + var include_path = DEFAULT_PLUG_DIR + "/" + include_key + if include_path in source: var is_excluded = false for exclude_key in exclude: - if exclude_key in source: + var exclude_path = DEFAULT_PLUG_DIR + "/" + exclude_key + if exclude_path in source: is_excluded = true break if not is_excluded: