From b3eafd1bce2f86691c0b70846ef7115a83214910 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 15 May 2024 20:33:50 +0300 Subject: [PATCH] add no-op mode for rustup script When calling this script, it immediately starts the download process. This change is mostly useful for when we want to source this file from another script file. Signed-off-by: onur-ozkan --- rustup-init.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rustup-init.sh b/rustup-init.sh index de0c317850..507ba7b2e0 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -23,8 +23,6 @@ is_zsh() { [ -n "${ZSH_VERSION-}" ] } -set -u - # If RUSTUP_UPDATE_ROOT is unset or empty, default it. RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}" @@ -808,4 +806,6 @@ get_strong_ciphersuites_for() { fi } -main "$@" || exit 1 +if [ "$NO_OP" != "1" ]; then + main "$@" || exit 1 +fi