diff --git a/README.md b/README.md index da225f8..c2fdc60 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,7 @@ func _plugging(): # Source other than github plug("https://gitlab.com/Xecestel/sound-manager") # Gitlab plug("file:///D/Godot/local-project/.git") # Local git repo + plug("../local-project/.git") # Local git repo using a relative path (identified by initial ./ or ../) connect("updated", "_on_plugin_updated") diff --git a/addons/gd-plug/plug.gd b/addons/gd-plug/plug.gd index 8c4b274..907b1da 100644 --- a/addons/gd-plug/plug.gd +++ b/addons/gd-plug/plug.gd @@ -374,6 +374,8 @@ func plug(repo, args={}): plugin.url = "" if ":" in repo: plugin.url = repo + elif repo.begins_with("../") or repo.begins_with("./"): + plugin.url = "../../" + repo elif repo.find("/") == repo.rfind("/"): plugin.url = DEFAULT_PLUGIN_URL % repo else: @@ -850,7 +852,7 @@ class _GitExecutable extends RefCounted: command = "git clone --depth=1 --single-branch --branch %s '%s' '%s'" % [branch if branch else tag, src, dest] elif commit: return clone_commit(src, dest, commit) - var exit = _execute(command, output) + var exit = _execute(command, output, true) logger.debug("Successfully cloned from %s" % src if exit == OK else "Failed to clone from %s" % src) return {"exit": exit, "output": output}