Skip to content

Commit 5b70f7f

Browse files
committed
Use println in chsrc
1 parent ba6fa80 commit 5b70f7f

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

src/framework/core.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* | Yangmoooo <[email protected]>
1010
* |
1111
* Created On : <2023-08-29>
12-
* Last Modified : <2025-06-19>
12+
* Last Modified : <2025-06-20>
1313
*
1414
* chsrc framework
1515
* ------------------------------------------------------------*/
@@ -631,7 +631,7 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor
631631
skip_reason = CliOpt_InEnglish ? "SKIP for no reason" : "无理由跳过";
632632
}
633633
measure_msgs[i] = xy_strjoin (4, " x ", msg, " ", yellow(skip_reason));
634-
printf ("%s\n", measure_msgs[i]);
634+
println (measure_msgs[i]);
635635
}
636636
else
637637
{
@@ -646,8 +646,7 @@ measure_speed_for_every_source (Source_t sources[], int size, double speed_recor
646646
measure_msgs[i] = xy_strjoin (3, " - ", msg, " ... ");
647647
}
648648

649-
650-
printf ("%s", measure_msgs[i]);
649+
print (measure_msgs[i]);
651650
fflush (stdout);
652651

653652
char *url_ = xy_strdup (url);

src/recipe/lang/Haskell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pl_haskell_setsrc (char *option)
4141
}
4242

4343
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
44-
puts (file); br();
44+
println (file); br();
4545

4646
config = xy_normalize_path ("~/.stack/config.yaml");
4747
file = xy_strjoin (3, "package-indices:\n"

src/recipe/lang/Java.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pl_java_setsrc (char *option)
8383

8484
char *maven_config = pl_java_find_maven_config ();
8585
chsrc_note2 (xy_strjoin (3, "请在您的 maven 配置文件 ", maven_config, " 中添加:"));
86-
puts (file);
86+
println (file);
8787
}
8888

8989
if (gradle_exist)

src/recipe/lang/Lua.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pl_lua_setsrc (char *option)
4646
"}");
4747

4848
chsrc_note2 ("请手动修改 ~/.luarocks/config.lua 文件 (用于下载):");
49-
puts (config);
49+
println (config);
5050

5151
char *upload_config = xy_strjoin (3, "key = \"<Your API Key>\"\n"
5252
"server = \"", source.url, "\"");

src/recipe/lang/Python/Rye.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pl_python_rye_setsrc (char *option)
4747

4848
char *rye_config = pl_python_find_rye_config ();
4949
chsrc_note2 (xy_strjoin (3, "请在您的 Rye 配置文件 ", rye_config, " 中添加:"));
50-
puts (file);
50+
println (file);
5151

5252
chsrc_determine_chgtype (ChgType_Manual);
5353
chsrc_conclude (&source);

src/recipe/ware/Anaconda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ wr_anaconda_setsrc (char *option)
7070
}
7171

7272
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
73-
puts (file);
73+
println (file);
7474

7575
chsrc_note2 ("然后运行 conda clean -i 清除索引缓存,保证用的是镜像站提供的索引");
7676

src/recipe/ware/Docker-Hub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ wr_dockerhub_setsrc (char *option)
135135
chsrc_append_to_file (to_add, WARE_DockerHub_SourceConfig);
136136
}
137137
// chsrc_note2 ("请向 /etc/docker/daemon.json 中添加下述内容:");
138-
// puts (to_add);
138+
// println (to_add);
139139
if (xy_on_linux)
140140
{
141141
// 由于 systemctl restart docker 会导致所有容器停止,所以不自动重启
@@ -151,7 +151,7 @@ wr_dockerhub_setsrc (char *option)
151151
{
152152
chsrc_note2 ("请打开Docker Desktop设置");
153153
chsrc_note2 ("选择“Docker Engine”选项卡,在该选项卡中找到“registry-mirrors”一栏,添加镜像地址:");
154-
puts (source.url);
154+
println (source.url);
155155
}
156156

157157
chsrc_determine_chgtype (ChgType_SemiAuto);

test/xy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ main (int argc, char const *argv[])
109109
assert (xy_dir_exist ("/etc"));
110110
}
111111

112-
113-
puts (xy_normalize_path (" \n ~/haha/test/123 \n\r "));
112+
println (xy_normalize_path (" \n ~/haha/test/123 \n\r "));
114113
assert_str (xy_normalize_path ("~/haha/test"), xy_parent_dir (" ~/haha/test/123"));
115114

116115
xy_succ ("测试完成", "xy.h 测试全部通过");

0 commit comments

Comments
 (0)