mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-24 01:09:34 +08:00
Update pl recipes
This commit is contained in:
parent
00f6deafb9
commit
7011fc1f79
@ -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);
|
||||
|
@ -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())
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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, " 中添加:"));
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user