添加 'rust-install.sh'

master
donny 2021-11-01 06:13:59 +00:00
parent 0fa4cbf197
commit ca8a41d7ab
1 changed files with 29 additions and 0 deletions

29
rust-install.sh Normal file
View File

@ -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