mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-14 10:57:28 +08:00
parent
ca00e0233b
commit
5cde6622b5
@ -1,9 +1,9 @@
|
|||||||
/** ------------------------------------------------------------
|
/** ------------------------------------------------------------
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* -------------------------------------------------------------
|
* -------------------------------------------------------------
|
||||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Yangmoooo <yangmoooo@outlook.com>
|
* Contributors : Yangmoooo <yangmoooo@outlook.com>
|
||||||
* | Mikachu2333 <mikachu.23333@zohomail.com>
|
* | Mikachu2333 <mikachu.23333@zohomail.com>
|
||||||
* |
|
* |
|
||||||
* Created On : <2024-10-02>
|
* Created On : <2024-10-02>
|
||||||
* Last Modified : <2025-06-19>
|
* Last Modified : <2025-06-19>
|
||||||
@ -19,16 +19,16 @@ static SourceProvider_t pl_rust_binary_upstream =
|
|||||||
* @update 2025-06-17
|
* @update 2025-06-17
|
||||||
*/
|
*/
|
||||||
static Source_t pl_rust_rustup_sources[] = {
|
static Source_t pl_rust_rustup_sources[] = {
|
||||||
{&pl_rust_binary_upstream, "https://static.rust-lang.org"},
|
{&pl_rust_binary_upstream, "https://static.rust-lang.org"},
|
||||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup"},
|
{&MirrorZ, "https://mirrors.cernet.edu.cn/rustup"},
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup"},
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup"},
|
||||||
{&Ustc, "https://mirrors.ustc.edu.cn/rust-static"},
|
{&Ustc, "https://mirrors.ustc.edu.cn/rust-static"},
|
||||||
{&Nju, "https://mirror.nju.edu.cn/rustup"},
|
{&Nju, "https://mirror.nju.edu.cn/rustup"},
|
||||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rust-static"},
|
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rust-static"},
|
||||||
{&Zju, "https://mirrors.zju.edu.cn/rustup"},
|
{&Zju, "https://mirrors.zju.edu.cn/rustup"},
|
||||||
{&Iscas, "https://mirror.iscas.ac.cn/rustup"},
|
{&Iscas, "https://mirror.iscas.ac.cn/rustup"},
|
||||||
{&Ali, "https://mirrors.aliyun.com/rustup"},
|
{&Ali, "https://mirrors.aliyun.com/rustup"},
|
||||||
{&RsProxyCN, "https://rsproxy.cn"}};
|
{&RsProxyCN, "https://rsproxy.cn"}};
|
||||||
def_sources_n(pl_rust_rustup);
|
def_sources_n(pl_rust_rustup);
|
||||||
|
|
||||||
|
|
||||||
@ -52,6 +52,16 @@ pl_rust_rustup_setsrc (char *option)
|
|||||||
{
|
{
|
||||||
chsrc_yield_source_and_confirm (pl_rust_rustup);
|
chsrc_yield_source_and_confirm (pl_rust_rustup);
|
||||||
|
|
||||||
|
#ifdef XY_On_Windows
|
||||||
|
|
||||||
|
char *cmd1 = xy_strjoin (3, "setx RUSTUP_DIST_SERVER \"", source.url, "\"");
|
||||||
|
char *cmd2 = xy_strjoin (3, "setx RUSTUP_UPDATE_ROOT \"", source.url, "/rustup\"");
|
||||||
|
|
||||||
|
char *cmd = xy_strjoin (3, cmd1, " & ", cmd2);
|
||||||
|
chsrc_run (cmd, RunOpt_Dont_Notify_On_Success|RunOpt_No_Last_New_Line);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
char *w1 = xy_strjoin (3, "export RUSTUP_DIST_SERVER=\"", source.url, "\"\n");
|
char *w1 = xy_strjoin (3, "export RUSTUP_DIST_SERVER=\"", source.url, "\"\n");
|
||||||
char *w2 = xy_strjoin (3, "export RUSTUP_UPDATE_ROOT=\"", source.url, "/rustup\"\n");
|
char *w2 = xy_strjoin (3, "export RUSTUP_UPDATE_ROOT=\"", source.url, "/rustup\"\n");
|
||||||
|
|
||||||
@ -82,6 +92,7 @@ pl_rust_rustup_setsrc (char *option)
|
|||||||
chsrc_backup (fishrc);
|
chsrc_backup (fishrc);
|
||||||
chsrc_append_to_file (w, fishrc);
|
chsrc_append_to_file (w, fishrc);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
chsrc_determine_chgtype (ChgType_Auto);
|
chsrc_determine_chgtype (ChgType_Auto);
|
||||||
chsrc_conclude (&source);
|
chsrc_conclude (&source);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user