From 08b213ae0b1f4fa914ef02b230830104ee53968f Mon Sep 17 00:00:00 2001 From: LinRan Date: Sat, 27 Dec 2025 20:09:24 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat(python/uv):=20=E6=94=AF=E6=8C=81Window?= =?UTF-8?q?s=E5=B9=B3=E5=8F=B0=E7=9A=84uv=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过PowerShell命令实现Windows平台上的文件操作, 替代原有的sed和grep命令,确保uv配置文件在Windows 环境下能够正确设置源地址。 --- src/recipe/lang/Python/uv.c | 49 +++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index 48b8e18b..d8347644 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -119,19 +119,6 @@ pl_python_uv_setsrc (char *option) const char *source_content = xy_str_gsub (RAWSTR_pl_python_uv_config_source_content, "@url@", source.url); -#if defined(XY_Build_On_macOS) || defined(XY_Build_On_BSD) - char *sed_cmd = "sed -i '' "; -#else - char *sed_cmd = "sed -i "; -#endif - - /** - * 将 [[index]] 到 default = true 之间的 url = ".*" 替换为 url = "source.url" - */ - char *update_config_cmd = xy_str_gsub (RAWSTR_pl_python_set_uv_config, "@sed@", sed_cmd); - update_config_cmd = xy_str_gsub (update_config_cmd, "@f@", uv_config); - update_config_cmd = xy_str_gsub (update_config_cmd, "@url@", source.url); - if (!xy_file_exist (uv_config)) { /* 当 uv_config 不存在,直接写入文件 */ @@ -140,12 +127,42 @@ pl_python_uv_setsrc (char *option) else { /* 当 uv_config 存在,如果存在 [[index]] 则更新,否则追加到文件末尾 */ - char *cmd = xy_str_gsub (RAWSTR_pl_python_test_uv_if_set_source, "@f@", uv_config); - chsrc_ensure_program ("grep"); + char *cmd = NULL; + if (xy.on_windows) + { + /* 在 Windows 上使用 PowerShell 替代 grep */ + cmd = xy_str_gsub("powershell -Command \"if (Get-Content @f@ | Select-String '^\\[\\[index\\]\\]$') { exit 0 } else { exit 1 }\"", "@f@", uv_config); + } + else + { + cmd = xy_str_gsub (RAWSTR_pl_python_test_uv_if_set_source, "@f@", uv_config); + } + int status = xy_run_get_status (cmd); if (0==status) { - chsrc_run (update_config_cmd, RunOpt_Default); + if (xy.on_windows) + { + /* 在 Windows 上使用 PowerShell 替代 sed */ + char *powershell_cmd_template = "powershell -Command \"$content = Get-Content '@f@'; $content = $content -replace '^url = \\\".*\\\"$', 'url = \\\"@url@\\\"'; $content | Set-Content '@f@'\""; + char *powershell_cmd_with_file = xy_str_gsub(powershell_cmd_template, "@f@", uv_config); + char *powershell_cmd = xy_str_gsub(powershell_cmd_with_file, "@url@", source.url); + chsrc_run (powershell_cmd, RunOpt_Default); + } + else + { + /* 非 Windows 系统使用 sed */ + char *sed_cmd = NULL; +#if defined(XY_Build_On_macOS) || defined(XY_Build_On_BSD) + sed_cmd = "sed -i '' "; +#else + sed_cmd = "sed -i "; +#endif + char *update_config_cmd = xy_str_gsub (RAWSTR_pl_python_set_uv_config, "@sed@", sed_cmd); + update_config_cmd = xy_str_gsub (update_config_cmd, "@f@", uv_config); + update_config_cmd = xy_str_gsub (update_config_cmd, "@url@", source.url); + chsrc_run (update_config_cmd, RunOpt_Default); + } } else { From e3112f8dbaa2fa4d6b2f1692e7c32f4af7327f5d Mon Sep 17 00:00:00 2001 From: LinRan Date: Sat, 27 Dec 2025 20:16:18 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat(python/uv):=20=E6=94=AF=E6=8C=81Window?= =?UTF-8?q?s=E5=B9=B3=E5=8F=B0=E7=9A=84uv=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在Windows平台上使用PowerShell替代sed和grep命令来处理uv配置文件 --- src/recipe/lang/Python/uv.c | 49 +++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index 48b8e18b..d8347644 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -119,19 +119,6 @@ pl_python_uv_setsrc (char *option) const char *source_content = xy_str_gsub (RAWSTR_pl_python_uv_config_source_content, "@url@", source.url); -#if defined(XY_Build_On_macOS) || defined(XY_Build_On_BSD) - char *sed_cmd = "sed -i '' "; -#else - char *sed_cmd = "sed -i "; -#endif - - /** - * 将 [[index]] 到 default = true 之间的 url = ".*" 替换为 url = "source.url" - */ - char *update_config_cmd = xy_str_gsub (RAWSTR_pl_python_set_uv_config, "@sed@", sed_cmd); - update_config_cmd = xy_str_gsub (update_config_cmd, "@f@", uv_config); - update_config_cmd = xy_str_gsub (update_config_cmd, "@url@", source.url); - if (!xy_file_exist (uv_config)) { /* 当 uv_config 不存在,直接写入文件 */ @@ -140,12 +127,42 @@ pl_python_uv_setsrc (char *option) else { /* 当 uv_config 存在,如果存在 [[index]] 则更新,否则追加到文件末尾 */ - char *cmd = xy_str_gsub (RAWSTR_pl_python_test_uv_if_set_source, "@f@", uv_config); - chsrc_ensure_program ("grep"); + char *cmd = NULL; + if (xy.on_windows) + { + /* 在 Windows 上使用 PowerShell 替代 grep */ + cmd = xy_str_gsub("powershell -Command \"if (Get-Content @f@ | Select-String '^\\[\\[index\\]\\]$') { exit 0 } else { exit 1 }\"", "@f@", uv_config); + } + else + { + cmd = xy_str_gsub (RAWSTR_pl_python_test_uv_if_set_source, "@f@", uv_config); + } + int status = xy_run_get_status (cmd); if (0==status) { - chsrc_run (update_config_cmd, RunOpt_Default); + if (xy.on_windows) + { + /* 在 Windows 上使用 PowerShell 替代 sed */ + char *powershell_cmd_template = "powershell -Command \"$content = Get-Content '@f@'; $content = $content -replace '^url = \\\".*\\\"$', 'url = \\\"@url@\\\"'; $content | Set-Content '@f@'\""; + char *powershell_cmd_with_file = xy_str_gsub(powershell_cmd_template, "@f@", uv_config); + char *powershell_cmd = xy_str_gsub(powershell_cmd_with_file, "@url@", source.url); + chsrc_run (powershell_cmd, RunOpt_Default); + } + else + { + /* 非 Windows 系统使用 sed */ + char *sed_cmd = NULL; +#if defined(XY_Build_On_macOS) || defined(XY_Build_On_BSD) + sed_cmd = "sed -i '' "; +#else + sed_cmd = "sed -i "; +#endif + char *update_config_cmd = xy_str_gsub (RAWSTR_pl_python_set_uv_config, "@sed@", sed_cmd); + update_config_cmd = xy_str_gsub (update_config_cmd, "@f@", uv_config); + update_config_cmd = xy_str_gsub (update_config_cmd, "@url@", source.url); + chsrc_run (update_config_cmd, RunOpt_Default); + } } else { From 8d768309d93e99f6af1832bf711115119b922827 Mon Sep 17 00:00:00 2001 From: LinRan Date: Sat, 27 Dec 2025 20:50:48 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat(python):=20=E6=9B=BF=E6=8D=A2=E4=B8=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/lang/Python/rawstr4c.h | 3 +++ src/recipe/lang/Python/uv.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/recipe/lang/Python/rawstr4c.h b/src/recipe/lang/Python/rawstr4c.h index 30b09578..c1a8dc09 100644 --- a/src/recipe/lang/Python/rawstr4c.h +++ b/src/recipe/lang/Python/rawstr4c.h @@ -14,3 +14,6 @@ char RAWSTR_pl_python_test_uv_if_set_source[] = "\x67\x72\x65\x70\x20\x2d\x71\x2 char RAWSTR_pl_python_rye_config[] = "\x5b\x5b\x73\x6f\x75\x72\x63\x65\x73\x5d\x5d\x0a\x6e\x61\x6d\x65\x20\x3d\x20\x22\x40\x31\x40\x22\x0a\x75\x72\x6c\x20\x20\x3d\x20\x22\x40\x32\x40\x22"; +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"; + +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"; \ No newline at end of file diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index d8347644..cfa832b7 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -131,7 +131,7 @@ pl_python_uv_setsrc (char *option) if (xy.on_windows) { /* 在 Windows 上使用 PowerShell 替代 grep */ - cmd = xy_str_gsub("powershell -Command \"if (Get-Content @f@ | Select-String '^\\[\\[index\\]\\]$') { exit 0 } else { exit 1 }\"", "@f@", uv_config); + cmd = xy_str_gsub (RAWSTR_pl_python_test_uv_if_set_source_on_windows, "@f@", uv_config); } else { @@ -144,8 +144,7 @@ pl_python_uv_setsrc (char *option) if (xy.on_windows) { /* 在 Windows 上使用 PowerShell 替代 sed */ - char *powershell_cmd_template = "powershell -Command \"$content = Get-Content '@f@'; $content = $content -replace '^url = \\\".*\\\"$', 'url = \\\"@url@\\\"'; $content | Set-Content '@f@'\""; - char *powershell_cmd_with_file = xy_str_gsub(powershell_cmd_template, "@f@", uv_config); + char *powershell_cmd_with_file = xy_str_gsub(RAWSTR_pl_python_set_uv_config_on_windows, "@f@", uv_config); char *powershell_cmd = xy_str_gsub(powershell_cmd_with_file, "@url@", source.url); chsrc_run (powershell_cmd, RunOpt_Default); } From ecf686576b9a27da9daac1e542fd00c96d81ab3d Mon Sep 17 00:00:00 2001 From: LinRan Date: Sat, 27 Dec 2025 20:58:51 +0800 Subject: [PATCH 4/6] =?UTF-8?q?docs(Python):=20=E6=B7=BB=E5=8A=A0Windows?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0uv=E9=85=8D=E7=BD=AE=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=92=8C=E6=B5=8B=E8=AF=95=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/lang/Python/rawstr4c.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/recipe/lang/Python/rawstr4c.md b/src/recipe/lang/Python/rawstr4c.md index f1c86761..7f87b616 100644 --- a/src/recipe/lang/Python/rawstr4c.md +++ b/src/recipe/lang/Python/rawstr4c.md @@ -45,6 +45,12 @@ grep -A 2 'index' @f@ | sed -n 's/^url = "\(.*\)"/\1/p' @sed@ '/^\[\[index\]\]$/,/^default = true$/{s|^url = ".*"$|url = "@url@"|;}' @f@ ``` +### Set uv config on Windows + +```powershell +powershell -Command "$content = Get-Content '@f@'; $content = $content -replace '^url = \".*\"$', 'url = \"@url@\"'; $content | Set-Content '@f@'" +``` + ### Test uv if set source @@ -52,6 +58,12 @@ grep -A 2 'index' @f@ | sed -n 's/^url = "\(.*\)"/\1/p' grep -q '^\[\[index]]$' @f@ ``` +### Test uv if set source on Windows + +```powershell +powershell -Command "if (Get-Content @f@ | Select-String '^\[\[index\]\]$') { exit 0 } else { exit 1 }" +``` +
@@ -64,4 +76,4 @@ grep -q '^\[\[index]]$' @f@ [[sources]] name = "@1@" url = "@2@" -``` +``` \ No newline at end of file From 1f2bf0bf3df4b037e4bb99a5a790f8e67c689308 Mon Sep 17 00:00:00 2001 From: LinRan Date: Sun, 28 Dec 2025 13:35:16 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat(contributors):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=B4=A1=E7=8C=AE=E8=80=85MingriLingran?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chsrc-main.c | 1 + src/recipe/lang/Python/uv.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 3869f564..0b48d497 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -75,6 +75,7 @@ chsrc_register_contributors () // 该 ID 为 Gitee ID chef_register_contributor ("@hezonglun", "HeZongLun", "hezonglun123456@outlook.com", NULL); chef_register_contributor ("@Young-Lord", "LY", "ly-niko@qq.com", NULL); + chef_register_contributor ("@MingriLingran", "MingriLingran", "i@linran.moe", NULL); /** * AI贡献者: diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index cfa832b7..d2caf9da 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -10,12 +10,12 @@ pl_python_uv_prelude (void) chef_prep_this (pl_python_uv, gsr); chef_set_created_on (this, "2024-12-11"); - chef_set_last_updated (this, "2025-12-17"); + chef_set_last_updated (this, "2025-12-28"); chef_set_sources_last_updated (this, "2025-08-09"); chef_set_chef (this, NULL); chef_set_cooks (this, 1, "@happy-game"); - chef_set_sauciers (this, 2, "@Kattos", "@ccmywish"); + chef_set_sauciers (this, 3, "@MingriLingran", "@Kattos", "@ccmywish"); chef_allow_local_mode (this, FullyCan, NULL, NULL); chef_allow_english(this); From 84503248d59de9e67fefac2b41557ae430dab276 Mon Sep 17 00:00:00 2001 From: LinRan Date: Sun, 28 Dec 2025 14:07:40 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat(python/uv):=20=E6=B7=BB=E5=8A=A0=20Win?= =?UTF-8?q?dows=20=E5=B9=B3=E5=8F=B0=20uv=20=E9=85=8D=E7=BD=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/lang/Python/rawstr4c.h | 5 ++++- src/recipe/lang/Python/rawstr4c.md | 7 +++++++ src/recipe/lang/Python/uv.c | 14 ++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/recipe/lang/Python/rawstr4c.h b/src/recipe/lang/Python/rawstr4c.h index c1a8dc09..c96f57d1 100644 --- a/src/recipe/lang/Python/rawstr4c.h +++ b/src/recipe/lang/Python/rawstr4c.h @@ -1,3 +1,4 @@ + #pragma once /** @@ -16,4 +17,6 @@ char RAWSTR_pl_python_rye_config[] = "\x5b\x5b\x73\x6f\x75\x72\x63\x65\x73\x5d\x 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"; -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"; \ No newline at end of file +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"; + +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"; \ No newline at end of file diff --git a/src/recipe/lang/Python/rawstr4c.md b/src/recipe/lang/Python/rawstr4c.md index 7f87b616..abcc2c43 100644 --- a/src/recipe/lang/Python/rawstr4c.md +++ b/src/recipe/lang/Python/rawstr4c.md @@ -39,6 +39,13 @@ grep -A 2 'index' @f@ | sed -n 's/^url = "\(.*\)"/\1/p' ``` +### Get uv config on Windows + +```powershell +powershell -Command "Get-Content '@f@'" +``` + + ### Set uv config ```sh diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index d2caf9da..05edd5f9 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -91,8 +91,18 @@ pl_python_uv_getsrc (char *option) } /* 获取 [[index]] 配置项的 url */ - char *cmd = xy_str_gsub (RAWSTR_pl_python_get_uv_config, "@f@", uv_config); - chsrc_run (cmd, RunOpt_Default); + char *cmd = NULL; + if (xy.on_windows) + { + /* 在 Windows 上使用 PowerShell 替代 grep */ + cmd = xy_str_gsub(RAWSTR_pl_python_get_uv_config_on_windows, "@f@", uv_config); + } + else + { + /* 在 Linux 或 macOS 上使用 grep */ + cmd = xy_str_gsub(RAWSTR_pl_python_get_uv_config, "@f@", uv_config); + } + chsrc_run(cmd, RunOpt_Default); }