Skip to content

Commit 64c4ec3

Browse files
authored
添加新贡献者MingriLingran,修复 Windows 平台 uv 配置获取
添加新贡献者MingriLingran,修复 Windows 平台 uv 配置获取
2 parents 52f2ea5 + 8450324 commit 64c4ec3

4 files changed

Lines changed: 26 additions & 5 deletions

File tree

src/chsrc-main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ chsrc_register_contributors ()
7575
// 该 ID 为 Gitee ID
7676
chef_register_contributor ("@hezonglun", "HeZongLun", "hezonglun123456@outlook.com", NULL);
7777
chef_register_contributor ("@Young-Lord", "LY", "ly-niko@qq.com", NULL);
78+
chef_register_contributor ("@MingriLingran", "MingriLingran", "i@linran.moe", NULL);
7879

7980
/**
8081
* AI贡献者:

src/recipe/lang/Python/rawstr4c.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#pragma once
23

34
/**
@@ -16,4 +17,6 @@ char RAWSTR_pl_python_rye_config[] = "\x5b\x5b\x73\x6f\x75\x72\x63\x65\x73\x5d\x
1617

1718
char RAWSTR_pl_python_test_uv_if_set_source_on_windows[] = "\x70\x6f\x77\x65\x72\x73\x68\x65\x6c\x6c\x20\x2d\x43\x6f\x6d\x6d\x61\x6e\x64\x20\x22\x69\x66\x20\x28\x47\x65\x74\x2d\x43\x6f\x6e\x74\x65\x6e\x74\x20\x40\x66\x40\x20\x7c\x20\x53\x65\x6c\x65\x63\x74\x2d\x53\x74\x72\x69\x6e\x67\x20\x27\x5e\x5c\x5b\x5c\x5b\x69\x6e\x64\x65\x78\x5c\x5d\x5c\x5d\x24\x27\x29\x20\x7b\x20\x65\x78\x69\x74\x20\x30\x20\x7d\x20\x65\x6c\x73\x65\x20\x7b\x20\x65\x78\x69\x74\x20\x31\x20\x7d\x22";
1819

19-
char RAWSTR_pl_python_set_uv_config_on_windows[] = "\x70\x6f\x77\x65\x72\x73\x68\x65\x6c\x6c\x20\x2d\x43\x6f\x6d\x6d\x61\x6e\x64\x20\x22\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x3d\x20\x47\x65\x74\x2d\x43\x6f\x6e\x74\x65\x6e\x74\x20\x27\x40\x66\x40\x27\x3b\x20\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x3d\x20\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x2d\x72\x65\x70\x6c\x61\x63\x65\x20\x27\x5e\x75\x72\x6c\x20\x3d\x20\x5c\x22\x2e\x2a\x5c\x22\x24\x27\x2c\x20\x27\x75\x72\x6c\x20\x3d\x20\x5c\x22\x40\x75\x72\x6c\x40\x5c\x22\x27\x3b\x20\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x7c\x20\x53\x65\x74\x2d\x43\x6f\x6e\x74\x65\x6e\x74\x20\x27\x40\x66\x40\x27\x22";
20+
char RAWSTR_pl_python_set_uv_config_on_windows[] = "\x70\x6f\x77\x65\x72\x73\x68\x65\x6c\x6c\x20\x2d\x43\x6f\x6d\x6d\x61\x6e\x64\x20\x22\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x3d\x20\x47\x65\x74\x2d\x43\x6f\x6e\x74\x65\x6e\x74\x20\x27\x40\x66\x40\x27\x3b\x20\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x3d\x20\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x2d\x72\x65\x70\x6c\x61\x63\x65\x20\x27\x5e\x75\x72\x6c\x20\x3d\x20\x5c\x22\x2e\x2a\x5c\x22\x24\x27\x2c\x20\x27\x75\x72\x6c\x20\x3d\x20\x5c\x22\x40\x75\x72\x6c\x40\x5c\x22\x27\x3b\x20\x24\x63\x6f\x6e\x74\x65\x6e\x74\x20\x7c\x20\x53\x65\x74\x2d\x43\x6f\x6e\x74\x65\x6e\x74\x20\x27\x40\x66\x40\x27\x22";
21+
22+
char RAWSTR_pl_python_get_uv_config_on_windows[] = "\x70\x6f\x77\x65\x72\x73\x68\x65\x6c\x6c\x20\x2d\x43\x6f\x6d\x6d\x61\x6e\x64\x20\x22\x47\x65\x74\x2d\x43\x6f\x6e\x74\x65\x6e\x74\x20\x27\x40\x66\x40\x27\x22";

src/recipe/lang/Python/rawstr4c.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ grep -A 2 'index' @f@ | sed -n 's/^url = "\(.*\)"/\1/p'
3939
```
4040

4141

42+
### Get uv config on Windows
43+
44+
```powershell
45+
powershell -Command "Get-Content '@f@'"
46+
```
47+
48+
4249
### Set uv config
4350

4451
```sh

src/recipe/lang/Python/uv.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ pl_python_uv_prelude (void)
1010
chef_prep_this (pl_python_uv, gsr);
1111

1212
chef_set_created_on (this, "2024-12-11");
13-
chef_set_last_updated (this, "2025-12-17");
13+
chef_set_last_updated (this, "2025-12-28");
1414
chef_set_sources_last_updated (this, "2025-08-09");
1515

1616
chef_set_chef (this, NULL);
1717
chef_set_cooks (this, 1, "@happy-game");
18-
chef_set_sauciers (this, 2, "@Kattos", "@ccmywish");
18+
chef_set_sauciers (this, 3, "@MingriLingran", "@Kattos", "@ccmywish");
1919

2020
chef_allow_local_mode (this, FullyCan, NULL, NULL);
2121
chef_allow_english(this);
@@ -91,8 +91,18 @@ pl_python_uv_getsrc (char *option)
9191
}
9292

9393
/* 获取 [[index]] 配置项的 url */
94-
char *cmd = xy_str_gsub (RAWSTR_pl_python_get_uv_config, "@f@", uv_config);
95-
chsrc_run (cmd, RunOpt_Default);
94+
char *cmd = NULL;
95+
if (xy.on_windows)
96+
{
97+
/* 在 Windows 上使用 PowerShell 替代 grep */
98+
cmd = xy_str_gsub(RAWSTR_pl_python_get_uv_config_on_windows, "@f@", uv_config);
99+
}
100+
else
101+
{
102+
/* 在 Linux 或 macOS 上使用 grep */
103+
cmd = xy_str_gsub(RAWSTR_pl_python_get_uv_config, "@f@", uv_config);
104+
}
105+
chsrc_run(cmd, RunOpt_Default);
96106
}
97107

98108

0 commit comments

Comments
 (0)