Skip to content

Commit 62341da

Browse files
Mikachu2333ccmywish
authored andcommitted
improve
1 parent 1a1a863 commit 62341da

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/recipe/ware/WinGet.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ wr_winget_prelude ()
1111
chef_allow_gsr(wr_winget);
1212

1313
chef_set_created_on (this, "2024-06-07");
14-
chef_set_last_updated (this, "2025-07-13");
14+
chef_set_last_updated (this, "2025-08-17");
1515
chef_set_sources_last_updated (this, "2025-07-13");
1616

1717
chef_set_authors (this, 1, "Aoran Zeng", "[email protected]");
1818
chef_set_chef (this, NULL, NULL);
1919
chef_set_cooks (this, 0);
20-
chef_set_contributors (this, 0);
20+
chef_set_contributors (this, 1, "Mikachu2333", "[email protected]");
2121

2222
chef_forbid_english(this);
2323
chef_allow_user_define(this);
@@ -46,9 +46,14 @@ wr_winget_getsrc (char *option)
4646
void
4747
wr_winget_setsrc (char *option)
4848
{
49-
use_this_source(wr_winget);
49+
use_this_source (wr_winget);
5050

51-
chsrc_run ("winget source remove winget", RunOpt_Default);
51+
// TODO:此处需要增加管理员权限校验
52+
char *msg = ENGLISH ? "This command needs ADMIN privilege" : "本命令需要管理员权限";
53+
chsrc_warn (msg);
54+
55+
// 2025.8.17 此前用户可能隐式使用默认源导致 remove 失败,故使用 Dont_Abort
56+
chsrc_run ("winget source remove winget", RunOpt_Dont_Abort_On_Failure);
5257
chsrc_run (xy_strjoin (3, "winget source add winget ", source.url, " --trust-level trusted"), RunOpt_Default);
5358

5459
chsrc_determine_chgtype (ChgType_Auto);

0 commit comments

Comments
 (0)