All use the uniform path

This commit is contained in:
Aoran Zeng 2023-09-27 18:47:49 +08:00
parent fe7e08c6a5
commit 17afaae1f4

23
chsrc.c
View File

@ -374,12 +374,8 @@ pl_go_setsrc (char* option)
void
pl_rust_getsrc (char* option)
{
if(xy_on_windows) {
chsrc_check_file ("%USERPROFILE%\\.cargo");
} else {
chsrc_check_file ("~/.cargo");
}
}
/**
* Rust https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index/
@ -399,7 +395,7 @@ pl_rust_setsrc (char* option)
"[source.mirror]\n"
"registry = \"sparse+", source.url, "\"");
chsrc_warn ("请您手动写入以下内容到 ~/.cargo 文件中:");
chsrc_warn (xy_strjoin(3, "请您手动写入以下内容到 ", xy_uniform_path("~/.cargo"), " 文件中:"));
puts(file);
chsrc_say_thanks(&source);
}
@ -694,7 +690,7 @@ pl_r_getsrc (char* option)
// options()$BioC_mirror
//
if (xy_on_windows) {
chsrc_check_file ("%USERPROFILE%\\Documents\\.Rprofile");
chsrc_check_file ("~/Documents/.Rprofile");
} else {
chsrc_check_file ("~/.Rprofile");
}
@ -720,15 +716,14 @@ pl_r_setsrc (char* option)
// 或者我们调用 r.exe --slave -e 上面的内容
if (xy_on_windows)
{
chsrc_append_to_file (towrite1, "%USERPROFILE%/Documents/.Rprofile");
chsrc_append_to_file (towrite2, "%USERPROFILE%/Documents/.Rprofile");
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");
}
chsrc_say_thanks(&source);
}
@ -744,12 +739,8 @@ pl_r_setsrc (char* option)
void
pl_julia_getsrc (char* option)
{
if(xy_on_windows) {
chsrc_check_file ("%USERPROFILE%\\.julia\\config\\startup.jl");
} else {
chsrc_check_file ("~/.julia/config/startup.jl");
}
}
/**
* Julia
@ -768,12 +759,10 @@ pl_julia_setsrc (char* option)
if (xy_on_windows) {
chsrc_run (xy_str_to_quietcmd ("md %USERPROFILE%\\.julia\\config"));
chsrc_append_to_file (towrite, "%USERPROFILE%/.julia/config/startup.jl");
}
else {
} else {
chsrc_run (xy_str_to_quietcmd ("mkdir -p ~/.julia/config"));
chsrc_append_to_file (towrite, "~/.julia/config/startup.jl");
}
chsrc_append_to_file (towrite, "~/.julia/config/startup.jl");
chsrc_say_thanks(&source);
}