mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-07 10:44:04 +08:00
remove useless error messages when uv
is set but no config file exists
This commit is contained in:
parent
b70e0c4d6b
commit
b560bc02aa
@ -94,15 +94,21 @@ pl_python_uv_setsrc (char *option)
|
|||||||
uv_config);
|
uv_config);
|
||||||
char *append_source_cmd = xy_strjoin (4, "printf '", source_content, "' >> ", uv_config);
|
char *append_source_cmd = xy_strjoin (4, "printf '", source_content, "' >> ", uv_config);
|
||||||
|
|
||||||
// grep -q '^[[index]]$' uv_config && update_source_cmd || append_source_cmd
|
char *cmd = NULL;
|
||||||
// 如果 uv_config 中存在 [[index]] 则更新, 否则追加到文件末尾
|
if (!xy_file_exist(uv_config)) {
|
||||||
// 文件不存在也是追加到新文件末尾
|
// uv_config 不存在,追加到新文件末尾
|
||||||
char *cmd = xy_strjoin (6, "grep -q '^\\[\\[index\\]\\]$' ",
|
// run: append_source_cmd
|
||||||
uv_config,
|
cmd = append_source_cmd;
|
||||||
" && ",
|
} else {
|
||||||
update_source_cmd,
|
// uv_config 存在,如果存在 [[index]] 则更新,否则追加到文件末尾
|
||||||
" || ",
|
// run: grep -q '^[[index]]$' uv_config && update_source_cmd || append_source_cmd
|
||||||
append_source_cmd);
|
cmd = xy_strjoin (6, "grep -q '^\\[\\[index\\]\\]$' ",
|
||||||
|
uv_config,
|
||||||
|
" && ",
|
||||||
|
update_source_cmd,
|
||||||
|
" || ",
|
||||||
|
append_source_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
chsrc_run (cmd, RunOpt_Default);
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user