Skip to content

Commit 4f3a3af

Browse files
committed
feat(rustup-init/sh): allow setting RUSTUP_VERSION during installation
1 parent 89b98b9 commit 4f3a3af

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rustup-init.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,15 @@ main() {
8787
;;
8888
esac
8989

90-
local _url="${RUSTUP_UPDATE_ROOT}/dist/${_arch}/rustup-init${_ext}"
90+
local _url
91+
if [ "${RUSTUP_VERSION+set}" = 'set' ]; then
92+
say "\`RUSTUP_VERSION\` has been set to \`${RUSTUP_VERSION}\`"
93+
_url="${RUSTUP_UPDATE_ROOT}/archive/${RUSTUP_VERSION}"
94+
else
95+
_url="${RUSTUP_UPDATE_ROOT}/dist"
96+
fi
97+
_url="${_url}/${_arch}/rustup-init${_ext}"
98+
9199

92100
local _dir
93101
if ! _dir="$(ensure mktemp -d)"; then

0 commit comments

Comments
 (0)