From 1358256045ce0883f3caeaca0d252a5143189db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B8=AD=E9=B8=AD=E3=80=8C=E3=82=AB=E3=83=A2=E3=80=8D?= <89643991+DuckDuckStudio@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:11:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=94=AF=E6=8C=81=E4=B8=8D?= =?UTF-8?q?=E7=94=A8=20winget-tools=20=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E4=B8=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这也是为弃用 sundry ignore 做准备。 --- src/function/maintain/config.py | 4 +--- src/tools/maintain/config.py | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/function/maintain/config.py b/src/function/maintain/config.py index 906cc31..dbd5ed5 100644 --- a/src/function/maintain/config.py +++ b/src/function/maintain/config.py @@ -90,9 +90,7 @@ class 配置信息: 必填项: list[str] = [ "paths.winget-pkgs", - "paths.winget-tools", - "repos.winget-pkgs", - "repos.winget-tools" + "repos.winget-pkgs" ] 最新版本: str = "1.4" diff --git a/src/tools/maintain/config.py b/src/tools/maintain/config.py index 52a17c6..ca9eb81 100644 --- a/src/tools/maintain/config.py +++ b/src/tools/maintain/config.py @@ -103,7 +103,7 @@ def 递归获取输入(配置字典: dict[str, Any], 当前路径: str="") -> No for 键 in ("paths", "repos"): # 必须要用户给的配置项 - 递归获取输入(默认配置[键], 键) + 默认配置[键]["winget-pkgs"] = 获取用户输入(f"{键}.winget-pkgs") if input(f"{MSHead.OptionalQuestion} 继续设置其他配置项? (默认为{Fore.YELLOW}否{Fore.RESET}): ").lower() in YES: for 键 in list(默认配置.keys()): @@ -120,6 +120,10 @@ def 递归获取输入(配置字典: dict[str, Any], 当前路径: str="") -> No if input(f"{MSHead.Question} 是否修改缓存配置? (默认为{Fore.YELLOW}否{Fore.RESET}): ").lower() in YES: 递归获取输入(默认配置["cache"], "cache") + if input(f"{MSHead.OptionalQuestion} 是否使用 ({Fore.YELLOW}将在未来弃用的{Fore.RESET}) sundry ignore? (默认为{Fore.YELLOW}否{Fore.RESET}): ").lower() in YES: + for 键 in ("paths", "repos"): + 默认配置[键]["winget-tools"] = 获取用户输入(f"{键}.winget-tools") + if not os.path.exists(os.path.dirname(配置信息.所在位置)): os.makedirs(os.path.dirname(配置信息.所在位置), exist_ok=True)