fix: recursive search for manifest.json after tar extraction (files may be nested)
This commit is contained in:
@@ -165,9 +165,13 @@ def do_restore():
|
||||
|
||||
manifest_file = None
|
||||
if os.path.isdir(remote_dir):
|
||||
for f in os.listdir(remote_dir):
|
||||
# Рекурсивный поиск manifest.json (может быть в подпапках после tar xzf)
|
||||
for root, _, files in os.walk(remote_dir):
|
||||
for f in files:
|
||||
if f.endswith("_manifest.json"):
|
||||
manifest_file = os.path.join(remote_dir, f)
|
||||
manifest_file = os.path.join(root, f)
|
||||
break
|
||||
if manifest_file:
|
||||
break
|
||||
if not manifest_file:
|
||||
raise RuntimeError("manifest.json не найден в папке архива")
|
||||
|
||||
Reference in New Issue
Block a user