Skip to content

Commit 340928f

Browse files
committed
remove useless error messages when uv is set but no config file exists
1 parent b560bc0 commit 340928f

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

src/chsrc-main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* | juzeon <[email protected]>
2424
* | Jialin Lyu <[email protected]>
2525
* | GitHub Copilot <https://github.com/copilot>
26+
2627
* |
2728
* Created On : <2023-08-28>
2829
* Last Modified : <2025-03-25>
@@ -851,4 +852,4 @@ main (int argc, char const *argv[])
851852
chsrc_error (msg);
852853
return Exit_Unknown;
853854
}
854-
}
855+
}

src/recipe/lang/Python/uv.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,23 @@ pl_python_uv_setsrc (char *option)
9595
char *append_source_cmd = xy_strjoin (4, "printf '", source_content, "' >> ", uv_config);
9696

9797
char *cmd = NULL;
98-
if (!xy_file_exist(uv_config)) {
99-
// uv_config 不存在,追加到新文件末尾
100-
// run: append_source_cmd
101-
cmd = append_source_cmd;
102-
} else {
103-
// uv_config 存在,如果存在 [[index]] 则更新,否则追加到文件末尾
104-
// run: grep -q '^[[index]]$' uv_config && update_source_cmd || append_source_cmd
105-
cmd = xy_strjoin (6, "grep -q '^\\[\\[index\\]\\]$' ",
106-
uv_config,
107-
" && ",
108-
update_source_cmd,
109-
" || ",
110-
append_source_cmd);
111-
}
98+
if (!xy_file_exist (uv_config))
99+
{
100+
// uv_config 不存在,追加到新文件末尾
101+
// run: append_source_cmd
102+
cmd = append_source_cmd;
103+
}
104+
else
105+
{
106+
// uv_config 存在,如果存在 [[index]] 则更新,否则追加到文件末尾
107+
// run: grep -q '^[[index]]$' uv_config && update_source_cmd || append_source_cmd
108+
cmd = xy_strjoin (6, "grep -q '^\\[\\[index\\]\\]$' ",
109+
uv_config,
110+
" && ",
111+
update_source_cmd,
112+
" || ",
113+
append_source_cmd);
114+
}
112115

113116
chsrc_run (cmd, RunOpt_Default);
114117

0 commit comments

Comments
 (0)