diff --git a/src/framework/core.c b/src/framework/core.c index d6ff5e7..580c8b0 100644 --- a/src/framework/core.c +++ b/src/framework/core.c @@ -88,7 +88,15 @@ void chsrc_note2 (const char* str) { char *msg = CliOpt_InEnglish ? "NOTE" : "提示"; - xy_log_brkt (yellow (App_Name), bdyellow (msg), yellow (str)); + xy_log_brkt (yellow(App_Name), bdyellow(msg), yellow(str)); +} + +void +chsrc_log_write (const char *file) +{ + char *msg = CliOpt_InEnglish ? "WRITE" : "写入"; + + xy_log_brkt (blue(App_Name), bdblue(msg), blue(file)); } #define YesMark "✓" diff --git a/src/recipe/lang/Julia.c b/src/recipe/lang/Julia.c index 22b44b9..96eaee5 100644 --- a/src/recipe/lang/Julia.c +++ b/src/recipe/lang/Julia.c @@ -48,10 +48,8 @@ pl_julia_setsrc (char *option) const char *towrite = xy_strjoin (3, "ENV[\"JULIA_PKG_SERVER\"] = \"", source.url, "\""); chsrc_append_to_file (towrite, PL_Julia_Config); - if (CliOpt_InEnglish) - chsrc_note2 ("Written to " PL_Julia_Config); - else - chsrc_note2 ("已写入 " PL_Julia_Config); + chsrc_log_write (PL_Julia_Config); + chsrc_conclude (&source, SetsrcType_Untested); } diff --git a/src/recipe/lang/R.c b/src/recipe/lang/R.c index 5a22b79..fadc11a 100644 --- a/src/recipe/lang/R.c +++ b/src/recipe/lang/R.c @@ -4,7 +4,7 @@ * File Authors : Aoran Zeng * Contributors : Nil Null * Created On : <2023-09-21> - * Last Modified : <2024-08-15> + * Last Modified : <2024-11-22> * ------------------------------------------------------------*/ /** @@ -27,6 +27,9 @@ pl_r_sources[] = { def_sources_n(pl_r); +#define PL_R_Config_Windows "~/Documents/.Rprofile" +#define PL_R_Config_POSIX "~/.Rprofile" + void pl_r_getsrc (char *option) { @@ -38,11 +41,11 @@ pl_r_getsrc (char *option) */ if (xy_on_windows) { - chsrc_view_file ("~/Documents/.Rprofile"); + chsrc_view_file (PL_R_Config_Windows); } else { - chsrc_view_file ("~/.Rprofile"); + chsrc_view_file (PL_R_Config_POSIX); } } @@ -61,16 +64,13 @@ pl_r_setsrc (char *option) const char *towrite2 = xy_strjoin (3, "options(BioC_mirror=\"", bioconductor_url, "\")" ); // 或者我们调用 r.exe --slave -e 上面的内容 - if (xy_on_windows) - { - chsrc_append_to_file (towrite1, "~/Documents/.Rprofile"); - chsrc_append_to_file (towrite2, "~/Documents/.Rprofile"); - } - else - { - chsrc_append_to_file (towrite1, "~/.Rprofile"); - chsrc_append_to_file (towrite2, "~/.Rprofile"); - } + + char *config = xy_on_windows ? PL_R_Config_Windows : PL_R_Config_POSIX; + + chsrc_append_to_file (towrite1, config); + chsrc_append_to_file (towrite2, config); + chsrc_log_write (config); + chsrc_conclude (&source, SetsrcType_Auto); }