mirror of
https://github.com/dtolnay/rust-toolchain.git
synced 2026-10-17 13:23:40 -05:00
Unify flags[@] and downgrade[@]
This commit is contained in:
+2
-3
@@ -85,12 +85,11 @@ runs:
|
|||||||
flags=()
|
flags=()
|
||||||
for t in ${targets//,/ }; do flags+=(--target "$t"); done
|
for t in ${targets//,/ }; do flags+=(--target "$t"); done
|
||||||
for c in ${components//,/ }; do flags+=(--component "$c"); done
|
for c in ${components//,/ }; do flags+=(--component "$c"); done
|
||||||
downgrade=()
|
if [[ $toolchain == nightly && -n $components ]]; then flags+=(--allow-downgrade); fi
|
||||||
if [[ $toolchain == nightly && -n $components ]]; then downgrade=(--allow-downgrade); fi
|
|
||||||
log=$(mktemp)
|
log=$(mktemp)
|
||||||
trap 'rm -f "$log"' EXIT
|
trap 'rm -f "$log"' EXIT
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if rustup toolchain install "$toolchain" "${flags[@]}" --profile minimal "${downgrade[@]}" --no-self-update --force-non-host 2>&1 | tee "$log"; then
|
if rustup toolchain install "$toolchain" "${flags[@]}" --profile minimal --no-self-update --force-non-host 2>&1 | tee "$log"; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
status=$?
|
status=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user