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

Added a prefix option #54

Merged
merged 3 commits into from
Aug 3, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions rustup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ BOOL_OPTIONS=""
VAL_OPTIONS=""

flag uninstall "only uninstall from the installation prefix"
valopt prefix "" "set installation prefix"
opt cargo 1 "install cargo with rust"

if [ $HELP -eq 1 ]
Expand Down Expand Up @@ -441,7 +442,13 @@ then
MAYBE_UNINSTALL="--uninstall"
fi

sh "${LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}"
MAYBE_PREFIX=
if [ -n "${CFG_PREFIX}" ]
then
MAYBE_PREFIX="--prefix=${CFG_PREFIX}"
fi

sh "${LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}" "${MAYBE_PREFIX}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you apply this change to the cargo installation below as well?

if [ $? -ne 0 ]
then
rm -Rf "${TMP_DIR}"
Expand All @@ -456,7 +463,7 @@ if [ -z "${CFG_DISABLE_CARGO}" ]; then
err "failed to unpack cargo installer"
fi

sh "${CARGO_LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}"
sh "${CARGO_LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}" "${MAYBE_PREFIX}"
if [ $? -ne 0 ]
then
rm -Rf "${TMP_DIR}"
Expand Down