mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-21 02:11:28 +08:00
Refactor target group mode
This commit is contained in:
@@ -30,7 +30,7 @@ pl_python_pdm_setsrc (char *option)
|
||||
{
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
if (!chsrc_in_target_group_mode())
|
||||
chsrc_confirm_source;
|
||||
|
||||
char *cmd = NULL;
|
||||
@@ -42,7 +42,7 @@ pl_python_pdm_setsrc (char *option)
|
||||
|
||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
if (!chsrc_in_target_group_mode())
|
||||
{
|
||||
chsrc_determine_chgtype (ChgType_Auto);
|
||||
chsrc_conclude (&source);
|
||||
|
@@ -29,7 +29,7 @@ pl_python_poetry_setsrc (char *option)
|
||||
{
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
if (!chsrc_in_target_group_mode())
|
||||
chsrc_confirm_source;
|
||||
|
||||
char *cmd = NULL;
|
||||
@@ -40,7 +40,7 @@ pl_python_poetry_setsrc (char *option)
|
||||
cmd = xy_2strjoin ("poetry source add my_mirror ", source.url);
|
||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
if (!chsrc_in_target_group_mode())
|
||||
{
|
||||
chsrc_determine_chgtype (ChgType_Auto);
|
||||
chsrc_conclude (&source);
|
||||
|
@@ -57,7 +57,7 @@ pl_python_setsrc (char *option)
|
||||
|
||||
pl_python_check_unofficial_pkger (&poetry_exist, &pdm_exist, &uv_exist);
|
||||
|
||||
ProgMode_Target_Group = true;
|
||||
chsrc_set_target_group_mode ();
|
||||
chsrc_yield_source_and_confirm (pl_python);
|
||||
|
||||
|
||||
|
@@ -40,7 +40,7 @@ pl_python_pip_setsrc (char *option)
|
||||
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
if (!chsrc_in_target_group_mode())
|
||||
chsrc_confirm_source;
|
||||
|
||||
char *py_prog_name = NULL;
|
||||
@@ -52,7 +52,7 @@ pl_python_pip_setsrc (char *option)
|
||||
char *cmd = xy_2strjoin (py_prog_name, xy_2strjoin (" -m pip config --user set global.index-url ", source.url));
|
||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
if (!chsrc_in_target_group_mode())
|
||||
{
|
||||
chsrc_determine_chgtype (ChgType_Auto);
|
||||
chsrc_conclude (&source);
|
||||
|
Reference in New Issue
Block a user