build: pin JD Cargo to domestic sparse source
This commit is contained in:
parent
cf22f436de
commit
b60b5783f8
@ -27,10 +27,10 @@ if ! command -v cargo >/dev/null 2>&1; then
|
|||||||
export RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://rsproxy.cn/rustup}"
|
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
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
||||||
fi
|
fi
|
||||||
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="${CARGO_REGISTRIES_CRATES_IO_PROTOCOL:-sparse}"
|
export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo-jd}"
|
||||||
export CARGO_REGISTRIES_CRATES_IO_INDEX="${CARGO_REGISTRIES_CRATES_IO_INDEX:-sparse+https://rsproxy.cn/index/}"
|
mkdir -p "$CARGO_HOME"
|
||||||
export CARGO_SOURCE_CRATES_IO_REPLACE_WITH="${CARGO_SOURCE_CRATES_IO_REPLACE_WITH:-rsproxy}"
|
cp scripts/cargo-config-jd.toml "$CARGO_HOME/config.toml"
|
||||||
export CARGO_SOURCE_RSPROXY_REGISTRY="${CARGO_SOURCE_RSPROXY_REGISTRY:-sparse+https://rsproxy.cn/index/}"
|
export PATH="$CARGO_HOME/bin:$HOME/.cargo/bin:$PATH"
|
||||||
|
|
||||||
if ! command -v corepack >/dev/null 2>&1; then
|
if ! command -v corepack >/dev/null 2>&1; then
|
||||||
npm install --global corepack
|
npm install --global corepack
|
||||||
|
|||||||
8
scripts/cargo-config-jd.toml
Normal file
8
scripts/cargo-config-jd.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[source.crates-io]
|
||||||
|
replace-with = "rsproxy-sparse"
|
||||||
|
|
||||||
|
[source.rsproxy-sparse]
|
||||||
|
registry = "sparse+https://rsproxy.cn/index/"
|
||||||
|
|
||||||
|
[net]
|
||||||
|
git-fetch-with-cli = true
|
||||||
Loading…
x
Reference in New Issue
Block a user