Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit a8ee20d

Browse files
committed
Merge pull request #54 from abdulsattar/gh-pages
Added a prefix option
2 parents ef1291a + 057b3d0 commit a8ee20d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

rustup.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ BOOL_OPTIONS=""
254254
VAL_OPTIONS=""
255255

256256
flag uninstall "only uninstall from the installation prefix"
257+
valopt prefix "" "set installation prefix"
257258
opt cargo 1 "install cargo with rust"
258259

259260
if [ $HELP -eq 1 ]
@@ -441,7 +442,13 @@ then
441442
MAYBE_UNINSTALL="--uninstall"
442443
fi
443444

444-
sh "${LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}"
445+
MAYBE_PREFIX=
446+
if [ -n "${CFG_PREFIX}" ]
447+
then
448+
MAYBE_PREFIX="--prefix=${CFG_PREFIX}"
449+
fi
450+
451+
sh "${LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}" "${MAYBE_PREFIX}"
445452
if [ $? -ne 0 ]
446453
then
447454
rm -Rf "${TMP_DIR}"
@@ -456,7 +463,7 @@ if [ -z "${CFG_DISABLE_CARGO}" ]; then
456463
err "failed to unpack cargo installer"
457464
fi
458465

459-
sh "${CARGO_LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}"
466+
sh "${CARGO_LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}" "${MAYBE_PREFIX}"
460467
if [ $? -ne 0 ]
461468
then
462469
rm -Rf "${TMP_DIR}"

0 commit comments

Comments
 (0)