From ca8a41d7abb69fe5a1d4270ee2d950f04d34a2d2 Mon Sep 17 00:00:00 2001 From: donny Date: Mon, 1 Nov 2021 06:13:59 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'rust-install.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rust-install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 rust-install.sh diff --git a/rust-install.sh b/rust-install.sh new file mode 100644 index 0000000..b584b19 --- /dev/null +++ b/rust-install.sh @@ -0,0 +1,29 @@ +#!/bin/sh +set -e + +echo "Init Rust..." + +echo export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static>>/etc/profile +echo export export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup>>/etc/profile +echo export CARGO_HTTP_MULTIPLEXING=false>>/etc/profile + +source /etc/profile + +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + +tee $HOME/cargo/config <<-'EOF' +[source.crates-io] +registry = "https://github.com/rust-lang/crates.io-index" +replace-with = 'ustc' +[source.ustc] +registry = "git://mirrors.ustc.edu.cn/crates.io-index" +#registry = "https://mirrors.ustc.edu.cn/crates.io-index" +EOF + +source $HOME/.cargo/env + +rustup -V + +rustup toolchain install nightly + +rustup -V \ No newline at end of file