mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-08 02:12:32 -05:00
Add data_manager.instance_name() public API (#6146)
This commit is contained in:
@@ -217,7 +217,7 @@ async def create_backup(dest: Path = Path.home()) -> Optional[Path]:
|
||||
|
||||
dest.mkdir(parents=True, exist_ok=True)
|
||||
timestr = datetime.utcnow().strftime("%Y-%m-%dT%H-%M-%S")
|
||||
backup_fpath = dest / f"redv3_{data_manager.instance_name}_{timestr}.tar.gz"
|
||||
backup_fpath = dest / f"redv3_{data_manager.instance_name()}_{timestr}.tar.gz"
|
||||
|
||||
to_backup = []
|
||||
exclusions = [
|
||||
@@ -242,7 +242,7 @@ async def create_backup(dest: Path = Path.home()) -> Optional[Path]:
|
||||
json.dump(repo_output, fs, indent=4)
|
||||
instance_file = data_path / "instance.json"
|
||||
with instance_file.open("w") as fs:
|
||||
json.dump({data_manager.instance_name: data_manager.basic_config}, fs, indent=4)
|
||||
json.dump({data_manager.instance_name(): data_manager.basic_config}, fs, indent=4)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user