build: enforce JD Cargo source replacement
This commit is contained in:
parent
86447ae197
commit
cf22f436de
@ -19,6 +19,7 @@ if command -v apt-get >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
command -v node >/dev/null || { echo "Node.js is required." >&2; exit 2; }
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
if ! command -v cargo >/dev/null 2>&1; then
|
||||
command -v curl >/dev/null || { echo "curl is required to install Rust." >&2; exit 2; }
|
||||
@ -26,9 +27,10 @@ if ! command -v cargo >/dev/null 2>&1; then
|
||||
export RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://rsproxy.cn/rustup}"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
||||
fi
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="${CARGO_REGISTRIES_CRATES_IO_PROTOCOL:-sparse}"
|
||||
export CARGO_REGISTRIES_CRATES_IO_INDEX="${CARGO_REGISTRIES_CRATES_IO_INDEX:-sparse+https://rsproxy.cn/index/}"
|
||||
export CARGO_SOURCE_CRATES_IO_REPLACE_WITH="${CARGO_SOURCE_CRATES_IO_REPLACE_WITH:-rsproxy}"
|
||||
export CARGO_SOURCE_RSPROXY_REGISTRY="${CARGO_SOURCE_RSPROXY_REGISTRY:-sparse+https://rsproxy.cn/index/}"
|
||||
|
||||
if ! command -v corepack >/dev/null 2>&1; then
|
||||
npm install --global corepack
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user