From b35ff8e1d08c46a144b0221c890dfee97fd224b5 Mon Sep 17 00:00:00 2001 From: palmtree5 <3577255+palmtree5@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:32:38 -0900 Subject: [PATCH 1/2] Ensure the repo list is included in backups --- redbot/core/utils/_internal_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/utils/_internal_utils.py b/redbot/core/utils/_internal_utils.py index 5ea383549c9..26ecc315549 100644 --- a/redbot/core/utils/_internal_utils.py +++ b/redbot/core/utils/_internal_utils.py @@ -246,7 +246,7 @@ async def create_backup(dest: Path = Path.home()) -> Optional[Path]: for f in data_path.glob("**/*"): if not any(ex in str(f) for ex in exclusions) and f.is_file(): to_backup.append(f) - + to_backup.append(repos_file) # manually include this file because the code above excludes it with tarfile.open(str(backup_fpath), "w:gz") as tar: for f in to_backup: tar.add(str(f), arcname=str(f.relative_to(data_path)), recursive=False) From 74e471a8b50476b3fdce0602d7eceecc0c187cea Mon Sep 17 00:00:00 2001 From: palmtree5 <3577255+palmtree5@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:38:58 -0900 Subject: [PATCH 2/2] style --- redbot/core/utils/_internal_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redbot/core/utils/_internal_utils.py b/redbot/core/utils/_internal_utils.py index 26ecc315549..18581c75927 100644 --- a/redbot/core/utils/_internal_utils.py +++ b/redbot/core/utils/_internal_utils.py @@ -246,7 +246,7 @@ async def create_backup(dest: Path = Path.home()) -> Optional[Path]: for f in data_path.glob("**/*"): if not any(ex in str(f) for ex in exclusions) and f.is_file(): to_backup.append(f) - to_backup.append(repos_file) # manually include this file because the code above excludes it + to_backup.append(repos_file) # manually include this file because the code above excludes it with tarfile.open(str(backup_fpath), "w:gz") as tar: for f in to_backup: tar.add(str(f), arcname=str(f.relative_to(data_path)), recursive=False)