Skip to content

Commit 6264e98

Browse files
authored
Merge pull request #3012 from SabrinaJewson/subshell-ensure
Correctly propagate subshell failures in rustup-init
2 parents 5fe3fc3 + 34c32a8 commit 6264e98

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rustup-init.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ main() {
7272
local _url="${RUSTUP_UPDATE_ROOT}/dist/${_arch}/rustup-init${_ext}"
7373

7474
local _dir
75-
_dir="$(ensure mktemp -d)"
75+
if ! _dir="$(ensure mktemp -d)"; then
76+
# Because the previous command ran in a subshell, we must manually
77+
# propagate exit status.
78+
exit 1
79+
fi
7680
local _file="${_dir}/rustup-init${_ext}"
7781

7882
local _ansi_escapes_are_valid=false

0 commit comments

Comments
 (0)