添加 'rust-install.sh'
parent
0fa4cbf197
commit
ca8a41d7ab
|
|
@ -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
|
||||||
Loading…
Reference in New Issue