Skip to content

Commit 34c32a8

Browse files
committed
Use if instead of $?
1 parent e5748eb commit 34c32a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rustup-init.sh

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

7474
local _dir
75-
_dir="$(ensure mktemp -d)"
76-
# Because the previous command ran in a subshell, we must manually propagate
77-
# exit status.
78-
[ $? -ne 0 ] && exit 1
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
7980
local _file="${_dir}/rustup-init${_ext}"
8081

8182
local _ansi_escapes_are_valid=false

0 commit comments

Comments
 (0)