From 2e6338dfd28cdd7b6ac64b643aed5a96ead4a8c5 Mon Sep 17 00:00:00 2001 From: rami3l Date: Mon, 16 Mar 2026 20:19:08 +0100 Subject: [PATCH] fix(rustup-init/sh): prevent passing `--default-host` twice --- rustup-init.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rustup-init.sh b/rustup-init.sh index 0648a91e6f..51cbc6996c 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -174,6 +174,17 @@ main() { exit 1 fi + # If a default host has been specified on the command line, we should + # revert our own override before calling the installer. + for arg in "$@"; do + case "$arg" in + --default-host|--default-host=*) + _default_host_override= + break + ;; + esac + done + if [ "$need_tty" = "yes" ] && [ ! -t 0 ]; then # The installer is going to want to ask for confirmation by # reading stdin. This script was piped into `sh` though and