Skip to content

Commit 5ccd609

Browse files
Mikachu2333ccmywish
authored andcommitted
chsrc_log_write 为覆写增加提示
1 parent 7648b6b commit 5ccd609

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/framework/core.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
* SPDX-License-Identifier: GPL-3.0-or-later
33
* -------------------------------------------------------------
44
* File Name : core.c
5-
* File Authors : 曾奥然 <[email protected]>
6-
* | 郭恒 <[email protected]>
7-
* Contributors : Peng Gao <[email protected]>
8-
* | Happy Game <[email protected]>
9-
* | Yangmoooo <[email protected]>
10-
* | BingChunMoLi <[email protected]>
5+
* File Authors : 曾奥然 <[email protected]>
6+
* | 郭恒 <[email protected]>
7+
* Contributors : Peng Gao <[email protected]>
8+
* | Happy Game <[email protected]>
9+
* | Yangmoooo <[email protected]>
10+
* | BingChunMoLi <[email protected]>
11+
* | Mikachu2333 <[email protected]>
1112
* |
1213
* Created On : <2023-08-29>
13-
* Last Modified : <2025-09-12>
14+
* Last Modified : <2025-09-29>
1415
*
1516
* chsrc framework
1617
* ------------------------------------------------------------*/
@@ -239,9 +240,9 @@ chsrc_init_framework ()
239240

240241

241242
void
242-
chsrc_log_write (const char *filename)
243+
chsrc_log_write (const char *filename, bool is_overwrite)
243244
{
244-
char *msg = ENGLISH ? "WRITE" : "写入";
245+
char *msg = is_overwrite ? (ENGLISH ? "OVERWRITE" : "覆写") : (ENGLISH ? "WRITE" : "写入");
245246

246247
xy_log_brkt (blue(App_Name), bdblue(msg), blue(filename));
247248
}
@@ -1673,7 +1674,7 @@ chsrc_append_to_file (const char *str, const char *filename)
16731674

16741675
log_anyway:
16751676
/* 输出recipe指定的文件名 */
1676-
chsrc_log_write (filename);
1677+
chsrc_log_write (filename, false);
16771678

16781679
/*
16791680
char *cmd = NULL;
@@ -1714,7 +1715,7 @@ chsrc_prepend_to_file (const char *str, const char *filename)
17141715

17151716
log_anyway:
17161717
/* 输出recipe指定的文件名 */
1717-
chsrc_log_write (filename);
1718+
chsrc_log_write (filename, false);
17181719
}
17191720

17201721
static void
@@ -1742,7 +1743,7 @@ chsrc_overwrite_file (const char *str, const char *filename)
17421743

17431744
log_anyway:
17441745
/* 输出recipe指定的文件名 */
1745-
chsrc_log_write (filename);
1746+
chsrc_log_write (filename, true);
17461747
}
17471748

17481749
static void

0 commit comments

Comments
 (0)