mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-21 02:11:28 +08:00
Use new ProgMode
This commit is contained in:
@@ -35,7 +35,7 @@ pl_python_pdm_setsrc (char *option)
|
||||
|
||||
char *cmd = NULL;
|
||||
|
||||
if (CliOpt_Locally==true)
|
||||
if (chsrc_in_local_mode())
|
||||
cmd = xy_2strjoin ("pdm config --local pypi.url ", source.url);
|
||||
else
|
||||
cmd = xy_2strjoin ("pdm config --global pypi.url ", source.url);
|
||||
|
@@ -34,7 +34,7 @@ pl_python_poetry_setsrc (char *option)
|
||||
|
||||
char *cmd = NULL;
|
||||
|
||||
if (CliOpt_Locally==false)
|
||||
if (!chsrc_in_local_mode())
|
||||
chsrc_note2 ("Poertry 仅支持项目级换源");
|
||||
|
||||
cmd = xy_2strjoin ("poetry source add my_mirror ", source.url);
|
||||
|
@@ -44,7 +44,7 @@ void
|
||||
pl_python_setsrc (char *option)
|
||||
{
|
||||
{
|
||||
char *msg = CliOpt_InEnglish ? "Three package managers will be replaced for you at the same time: " \
|
||||
char *msg = ENGLISH ? "Three package managers will be replaced for you at the same time: " \
|
||||
"pip, Poetry, PDM. If you need to change the source independently, " \
|
||||
"please run independently `chsrc set <pkg-manager>`"
|
||||
: "将同时为您更换4个包管理器 pip, Poetry, PDM, uv 的源,若需要独立换源,请独立运行 chsrc set <pkg-manager>";
|
||||
|
@@ -30,9 +30,9 @@ void
|
||||
pl_python_pip_setsrc (char *option)
|
||||
{
|
||||
// 对于不支持的情况,尽早结束
|
||||
if (CliOpt_Locally)
|
||||
if (chsrc_in_local_mode())
|
||||
{
|
||||
char *msg = CliOpt_InEnglish ? "pip doesn't support `-local`. SKIP changing source!" : "pip 不支持 -local,跳过换源";
|
||||
char *msg = ENGLISH ? "pip doesn't support `-local`. SKIP changing source!" : "pip 不支持 -local,跳过换源";
|
||||
chsrc_error (msg);
|
||||
// 不能直接退出,因为 Leader target 不能就此结束
|
||||
return;
|
||||
|
@@ -27,7 +27,7 @@
|
||||
char *
|
||||
pl_python_find_uv_config (bool mkdir)
|
||||
{
|
||||
if (CliOpt_Locally)
|
||||
if (chsrc_in_local_mode())
|
||||
{
|
||||
return xy_2strjoin (UV_LOCAL_CONFIG_PATH, UV_CONFIG);
|
||||
}
|
||||
|
Reference in New Issue
Block a user