Update pl recipes

This commit is contained in:
Aoran Zeng 2025-07-21 21:09:11 +08:00
parent 00f6deafb9
commit 7011fc1f79
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
5 changed files with 38 additions and 20 deletions

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* Created On : <2023-09-10>
* Last Modified : <2025-07-16>
* Last Modified : <2025-07-21>
* ------------------------------------------------------------*/
#include "rawstr4c.h"
@ -33,9 +33,13 @@ pl_haskell_setsrc (char *option)
{
chsrc_yield_source_and_confirm (pl_haskell);
char *file = xy_strjoin (3, "repository mirror\n"
" url: ", source.url,
"\n secure: True");
char *file = R"(
repository mirror
url: @url@
secure: True
)";
file = xy_str_gsub (file, "@url@", source.url);
char *config = NULL;
if (xy_on_windows)
@ -48,7 +52,7 @@ pl_haskell_setsrc (char *option)
}
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
println (file); br();
println (file);
config = xy_normalize_path ("~/.stack/config.yaml");
file = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Lontten <lontten@163.com>
* Created On : <2024-09-29>
* Last Modified : <2025-07-11>
* Last Modified : <2025-07-21>
* ------------------------------------------------------------*/
/**
@ -30,8 +30,13 @@ pl_nodejs_bun_setsrc (char *option)
// 用的是 npm Registry 的源
chsrc_yield_source (pl_nodejs_group);
char *file = xy_strjoin(3, "[install]\n"
"registry = \"", source.url, "\"");
char *file =
R"(
[install]
registry = "@url@"
)";
file = xy_str_gsub (file, "@url@", source.url);
if (chsrc_in_local_mode())
{

View File

@ -19,7 +19,7 @@ pl_nodejs_check_cmd (bool *npm_exist, bool *yarn_exist, bool *pnpm_exist)
if (!*npm_exist && !*yarn_exist && !*pnpm_exist)
{
char *msg = ENGLISH ? "No npm, yarn or pnpm command found, check if at least one is present"
: "未找到 npm 或 yarn 或 pnpm 命令,请检查是否存在其一";
: "未找到 npm 或 yarn 或 pnpm 命令,请检查是否存在其一";
chsrc_error (msg);
exit (Exit_UserCause);
}

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nul None <nul@none.org>
* Created On : <2024-12-06>
* Last Modified : <2025-07-11>
* Last Modified : <2025-07-21>
*
* Rye已经有后继uv了Python group中
* ------------------------------------------------------------*/
@ -41,10 +41,15 @@ pl_python_rye_setsrc (char *option)
/* 并不在 Python group 中,所以不考虑 target group 情况 */
chsrc_yield_source_and_confirm (pl_python_group);
const char *file = xy_strjoin (7,
"[[sources]]\n",
"name = \"", source.mirror->abbr, "\"\n",
"url = \"", source.url, "\"");
const char *file =
R"(
[[sources]]
name = "@1@"
url = "@2@"
)";
file = xy_str_gsub (file, "@1@", source.mirror->abbr);
file = xy_str_gsub (file, "@2@", source.url);
char *rye_config = pl_python_find_rye_config ();
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));

View File

@ -84,15 +84,19 @@ pl_rust_cargo_setsrc (char *option)
{
chsrc_yield_source_and_confirm (pl_rust_cargo);
const char* file = xy_strjoin (3,
"[source.crates-io]\n"
"replace-with = 'mirror'\n\n"
const char *file =
R"toml(
[source.crates-io]
replace-with = 'mirror'
"[source.mirror]\n"
"registry = \"sparse+", source.url, "\"");
[source.mirror]
registry = "sparse+@url@"
)toml";
file = xy_str_gsub (file, "@url@", source.url);
chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
p(file);
println (file);
chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source);