From 54f4afd6e814cca72c497e7582072f91c0727f15 Mon Sep 17 00:00:00 2001 From: LeeCQ Date: Sat, 2 Mar 2024 22:28:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + tools/create_storage.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0a8f42b..77eb48e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ local_test* tmp/ config.json config.yaml +.DS_Store .alist-sync-cache/ alist_sync/.alist-sync-cache/ diff --git a/tools/create_storage.py b/tools/create_storage.py index 411234d..1dedfef 100644 --- a/tools/create_storage.py +++ b/tools/create_storage.py @@ -18,7 +18,7 @@ alist_config = json.loads(PROJECT_ROOT.joinpath("alist/data/config.json").read_text()) alist_port = alist_config["scheme"]["http_port"] -admin_password = os.getenv("_ALIST_ADMIN_PASSWORD", "123456") +admin_password = os.getenv("_ALIST_ADMIN_PASSWORD", ) or "123456" remote_url = os.getenv("_ALIST_BACKUP_URL") remote_username = os.getenv("_ALIST_BACKUP_USERNAME") @@ -30,9 +30,11 @@ password=admin_password, ) +print("local_client =", admin_password) # 如果--, 删除全部存储器 -if os.getenv("_RELOAD_STORAGE"): - for i in local_client.admin_storage_list().data.content: +print("_RELOAD_STORAGE =", os.getenv("_RELOAD_STORAGE")) +if os.getenv("_RELOAD_STORAGE") == "true": + for i in local_client.admin_storage_list().data.content or []: local_client.admin_storage_delete(i.id) # 创建本地存储器