From e5748eb7017ea81aef37f07ace00c29e9a715835 Mon Sep 17 00:00:00 2001 From: SabrinaJewson Date: Sun, 19 Jun 2022 20:08:02 +0100 Subject: [PATCH] Correctly propagate subshell failures in rustup-init --- rustup-init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rustup-init.sh b/rustup-init.sh index 25ebc940d3..e146ca7610 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -73,6 +73,9 @@ main() { local _dir _dir="$(ensure mktemp -d)" + # Because the previous command ran in a subshell, we must manually propagate + # exit status. + [ $? -ne 0 ] && exit 1 local _file="${_dir}/rustup-init${_ext}" local _ansi_escapes_are_valid=false