mirror of
https://github.com/RubyMetric/chsrc
synced 2025-09-10 02:32:47 +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>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Nil Null <nil@null.org>
|
* Contributors : Nil Null <nil@null.org>
|
||||||
* Created On : <2023-09-10>
|
* Created On : <2023-09-10>
|
||||||
* Last Modified : <2025-07-16>
|
* Last Modified : <2025-07-21>
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "rawstr4c.h"
|
#include "rawstr4c.h"
|
||||||
@ -33,9 +33,13 @@ pl_haskell_setsrc (char *option)
|
|||||||
{
|
{
|
||||||
chsrc_yield_source_and_confirm (pl_haskell);
|
chsrc_yield_source_and_confirm (pl_haskell);
|
||||||
|
|
||||||
char *file = xy_strjoin (3, "repository mirror\n"
|
char *file = R"(
|
||||||
" url: ", source.url,
|
repository mirror
|
||||||
"\n secure: True");
|
url: @url@
|
||||||
|
secure: True
|
||||||
|
)";
|
||||||
|
|
||||||
|
file = xy_str_gsub (file, "@url@", source.url);
|
||||||
|
|
||||||
char *config = NULL;
|
char *config = NULL;
|
||||||
if (xy_on_windows)
|
if (xy_on_windows)
|
||||||
@ -48,7 +52,7 @@ pl_haskell_setsrc (char *option)
|
|||||||
}
|
}
|
||||||
|
|
||||||
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
|
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
|
||||||
println (file); br();
|
println (file);
|
||||||
|
|
||||||
config = xy_normalize_path ("~/.stack/config.yaml");
|
config = xy_normalize_path ("~/.stack/config.yaml");
|
||||||
file = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);
|
file = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Lontten <lontten@163.com>
|
* Contributors : Lontten <lontten@163.com>
|
||||||
* Created On : <2024-09-29>
|
* 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 的源
|
// 用的是 npm Registry 的源
|
||||||
chsrc_yield_source (pl_nodejs_group);
|
chsrc_yield_source (pl_nodejs_group);
|
||||||
|
|
||||||
char *file = xy_strjoin(3, "[install]\n"
|
char *file =
|
||||||
"registry = \"", source.url, "\"");
|
R"(
|
||||||
|
[install]
|
||||||
|
registry = "@url@"
|
||||||
|
)";
|
||||||
|
|
||||||
|
file = xy_str_gsub (file, "@url@", source.url);
|
||||||
|
|
||||||
if (chsrc_in_local_mode())
|
if (chsrc_in_local_mode())
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Nul None <nul@none.org>
|
* Contributors : Nul None <nul@none.org>
|
||||||
* Created On : <2024-12-06>
|
* Created On : <2024-12-06>
|
||||||
* Last Modified : <2025-07-11>
|
* Last Modified : <2025-07-21>
|
||||||
*
|
*
|
||||||
* 由于Rye已经有后继uv了,所以我们不把该管理器纳入Python group中
|
* 由于Rye已经有后继uv了,所以我们不把该管理器纳入Python group中
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
@ -41,10 +41,15 @@ pl_python_rye_setsrc (char *option)
|
|||||||
/* 并不在 Python group 中,所以不考虑 target group 情况 */
|
/* 并不在 Python group 中,所以不考虑 target group 情况 */
|
||||||
chsrc_yield_source_and_confirm (pl_python_group);
|
chsrc_yield_source_and_confirm (pl_python_group);
|
||||||
|
|
||||||
const char *file = xy_strjoin (7,
|
const char *file =
|
||||||
"[[sources]]\n",
|
R"(
|
||||||
"name = \"", source.mirror->abbr, "\"\n",
|
[[sources]]
|
||||||
"url = \"", source.url, "\"");
|
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 ();
|
char *rye_config = pl_python_find_rye_config ();
|
||||||
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", 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);
|
chsrc_yield_source_and_confirm (pl_rust_cargo);
|
||||||
|
|
||||||
const char* file = xy_strjoin (3,
|
const char *file =
|
||||||
"[source.crates-io]\n"
|
R"toml(
|
||||||
"replace-with = 'mirror'\n\n"
|
[source.crates-io]
|
||||||
|
replace-with = 'mirror'
|
||||||
|
|
||||||
"[source.mirror]\n"
|
[source.mirror]
|
||||||
"registry = \"sparse+", source.url, "\"");
|
registry = "sparse+@url@"
|
||||||
|
)toml";
|
||||||
|
|
||||||
|
file = xy_str_gsub (file, "@url@", source.url);
|
||||||
|
|
||||||
chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
|
chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
|
||||||
p(file);
|
println (file);
|
||||||
|
|
||||||
chsrc_determine_chgtype (ChgType_Auto);
|
chsrc_determine_chgtype (ChgType_Auto);
|
||||||
chsrc_conclude (&source);
|
chsrc_conclude (&source);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user