mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-20 18:05:08 +08:00
全部使用 xy_strcat()
弃用 xy_strjoin()
This commit is contained in:
@@ -52,9 +52,9 @@ pl_python_pdm_setsrc (char *option)
|
||||
char *cmd = NULL;
|
||||
|
||||
if (chsrc_in_local_mode())
|
||||
cmd = xy_2strjoin ("pdm config --local pypi.url ", source.url);
|
||||
cmd = xy_2strcat ("pdm config --local pypi.url ", source.url);
|
||||
else
|
||||
cmd = xy_2strjoin ("pdm config --global pypi.url ", source.url);
|
||||
cmd = xy_2strcat ("pdm config --global pypi.url ", source.url);
|
||||
|
||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
|
@@ -50,7 +50,7 @@ pl_python_poetry_setsrc (char *option)
|
||||
if (!chsrc_in_local_mode())
|
||||
chsrc_alert2 ("Poetry 仅支持项目级换源");
|
||||
|
||||
cmd = xy_2strjoin ("poetry source add my_mirror ", source.url);
|
||||
cmd = xy_2strcat ("poetry source add my_mirror ", source.url);
|
||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (chsrc_in_standalone_mode())
|
||||
|
@@ -45,7 +45,7 @@ void
|
||||
pl_python_rye_getsrc (char *option)
|
||||
{
|
||||
char *rye_config = pl_python_find_rye_config ();
|
||||
chsrc_note2 (xy_strjoin (3, "请查看 ", rye_config, " 配置文件中的 [[sources]] 节内容"));
|
||||
chsrc_note2 (xy_strcat (3, "请查看 ", rye_config, " 配置文件中的 [[sources]] 节内容"));
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ pl_python_rye_setsrc (char *option)
|
||||
content = xy_str_gsub (content, "@2@", source.url);
|
||||
|
||||
char *rye_config = pl_python_find_rye_config ();
|
||||
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));
|
||||
chsrc_note2 (xy_strcat (3, "请在配置文件 ", rye_config, " 中添加:"));
|
||||
println (content);
|
||||
|
||||
chsrc_determine_chgtype (ChgType_Manual);
|
||||
|
@@ -14,7 +14,7 @@ static char *
|
||||
pl_python_speed_url_constructor (const char *url, const char *user_data)
|
||||
{
|
||||
char *str = xy_str_delete_suffix (url, "/simple");
|
||||
str = xy_2strjoin (str, "/packages/56/e4/55aaac2b15af4dad079e5af329a79d961e5206589d0e02b1e8da221472ed/tensorflow-2.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl");
|
||||
str = xy_2strcat (str, "/packages/56/e4/55aaac2b15af4dad079e5af329a79d961e5206589d0e02b1e8da221472ed/tensorflow-2.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl");
|
||||
return str;
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@ pl_python_pip_getsrc (char *option)
|
||||
char *py_prog_name = NULL;
|
||||
pl_python_get_py_program_name (&py_prog_name);
|
||||
|
||||
char *cmd = xy_2strjoin (py_prog_name, " -m pip config get global.index-url");
|
||||
char *cmd = xy_2strcat (py_prog_name, " -m pip config get global.index-url");
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ pl_python_pip_setsrc (char *option)
|
||||
// 这里用的是 config --user,会写入用户目录(而不是项目目录)
|
||||
// https://github.com/RubyMetric/chsrc/issues/39
|
||||
// 经测试,Windows上调用换源命令,会写入 C:\Users\RubyMetric\AppData\Roaming\pip\pip.ini
|
||||
char *cmd = xy_2strjoin (py_prog_name, xy_2strjoin (" -m pip config --user set global.index-url ", source.url));
|
||||
char *cmd = xy_2strcat (py_prog_name, xy_2strcat (" -m pip config --user set global.index-url ", source.url));
|
||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (chsrc_in_standalone_mode())
|
||||
|
@@ -51,7 +51,7 @@ pl_python_find_uv_config (bool mkdir)
|
||||
{
|
||||
if (chsrc_in_local_mode())
|
||||
{
|
||||
return xy_2strjoin (PL_Python_uv_Local_ConfigPath, PL_Python_uv_ConfigFile);
|
||||
return xy_2strcat (PL_Python_uv_Local_ConfigPath, PL_Python_uv_ConfigFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -66,12 +66,12 @@ pl_python_find_uv_config (bool mkdir)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *config_dir = xy_2strjoin(appdata, "\\uv\\");
|
||||
char *config_dir = xy_2strcat(appdata, "\\uv\\");
|
||||
if (mkdir)
|
||||
{
|
||||
chsrc_ensure_dir (config_dir);
|
||||
}
|
||||
return xy_2strjoin (config_dir, PL_Python_uv_ConfigFile);
|
||||
return xy_2strcat (config_dir, PL_Python_uv_ConfigFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -80,7 +80,7 @@ pl_python_find_uv_config (bool mkdir)
|
||||
{
|
||||
chsrc_ensure_dir (PL_Python_uv_User_ConfigPath);
|
||||
}
|
||||
return xy_2strjoin (PL_Python_uv_User_ConfigPath, PL_Python_uv_ConfigFile);
|
||||
return xy_2strcat (PL_Python_uv_User_ConfigPath, PL_Python_uv_ConfigFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user