fix(hotreload): only add dest_package_name to the cogs_to_reload list if dest_package_name != src_package_name
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 34s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 40s

fix(hotreload): only add `dest_package_name` to the `cogs_to_reload` list if `dest_package_name != src_package_name`
This commit is contained in:
cswimr 2025-01-26 00:31:02 +00:00
parent 5adc7a2c7b
commit 7d1a9cc01a
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -16,7 +16,7 @@ class HotReload(commands.Cog):
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs"
__version__ = "1.1.0"
__version__ = "1.1.1"
__documentation__ = "https://seacogs.coastalcommits.com/hotreload/"
def __init__(self, bot: Red) -> None:
@ -91,7 +91,9 @@ class HotReloadHandler(RegexMatchingEventHandler):
if isinstance(event, FileSystemMovedEvent):
dest = f" to {event.dest_path}"
relative_dest_path = Path(event.dest_path).relative_to(self.path)
cogs_to_reload.append(relative_dest_path.parts[0])
dest_package_name = relative_dest_path.parts[0]
if dest_package_name != src_package_name:
cogs_to_reload.append(dest_package_name)
else:
dest = ""