From 22237a21b1e968b88130bd99cc41fe491ac2bbcc Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 31 Jan 2024 15:48:23 -0500 Subject: [PATCH] fix(backup): doing some cleanup --- .docs/backup.md | 4 ++-- backup/backup.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.docs/backup.md b/.docs/backup.md index 787d1db..550f7da 100644 --- a/.docs/backup.md +++ b/.docs/backup.md @@ -20,6 +20,6 @@ Exports a JSON list of all of your added repositories, and their installed cogs. ### backup import -- Usage: `[p]backup import [json]` +- Usage: `[p]backup import` -Imports, reinstalls, and reloads cogs from a valid export. Requires the JSON export to be attached to the invoking message as an attachment. Ignores itself and PyLav cogs. +Reinstalls repositories and cogs from a valid export. Requires the JSON export to be attached to the invoking message as an attachment. Ignores itself and PyLav cogs, due to possible conflicts with Docker images. diff --git a/backup/backup.py b/backup/backup.py index 2fe0946..8c3b9c8 100644 --- a/backup/backup.py +++ b/backup/backup.py @@ -59,7 +59,9 @@ class Backup(commands.Cog): if cog.repo_name == repo.name: cog_dict = { "name": cog.name, - "loaded": ctx.bot.get_cog(cog.name) is not None, + # "loaded": cog.name in ctx.bot.extensions.keys(), + # this functionality was planned but never implemented due to Red limitations + # and the possibility of restoration functionality being added to Core "pinned": cog.pinned, "commit": cog.commit } @@ -178,6 +180,10 @@ class Backup(commands.Cog): else: commit = None + # If you're forking this cog, make sure to change these strings! + if cog_name == 'backup' and 'SeaswimmerTheFsh/SeaCogs' in url: + continue + async with repository.checkout(commit, exit_to_rev=repository.branch): cogs_c, message = await downloader._filter_incorrect_cogs_by_names(repository, [cog_name]) # pylint: disable=protected-access if not cogs_c: