fix: parse parent directory
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run

This commit is contained in:
aclist committed 2026-06-28 23:52:13 +09:00
1 parent 4c31cd7ecd
commit 4de5147899
4 files changed
+51 -40

No files matched your search

+8 -7
View File
@@ -66,18 +66,19 @@ def copy_bare_configs(config: "Path", resolution: "Path") -> tuple[bool, bool]:
]
config_changed = False
state_changed = False
if APP_NAME_LOWER not in str(config):
new_file = config.parent / APP_NAME_LOWER / conf
if config.is_file():
if config.parent.exists() is False:
new_file = config
old_file = config.parent.parent / conf
if old_file.is_file():
make_parents(new_file)
shutil.copy(config, new_file)
shutil.copy(old_file, new_file)
config_changed = True
if APP_NAME_LOWER not in str(resolution):
if resolution.parent.exists() is False:
state_path = resolution.parent
for state_file in state:
old_file = state_path / state_file
old_file = state_path.parent / state_file
if old_file.is_file():
new_file = state_path / APP_NAME_LOWER / state_file
new_file = state_path / state_file
make_parents(new_file)
shutil.copy(old_file, new_file)
state_changed = True