File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -389,6 +389,17 @@ esac
389
389
390
390
msg " host triple: ${HOST_TRIPLE} "
391
391
392
+ CFG_INSTALL_FLAGS=" "
393
+ if [ -n " ${CFG_UNINSTALL} " ]
394
+ then
395
+ CFG_INSTALL_FLAGS=" ${CFG_INSTALL_FLAGS} --uninstall"
396
+ fi
397
+
398
+ if [ -n " ${CFG_PREFIX} " ]
399
+ then
400
+ CFG_INSTALL_FLAGS=" ${CFG_INSTALL_FLAGS} --prefix=${CFG_PREFIX} "
401
+ fi
402
+
392
403
CFG_TMP_DIR=" ./rustup-tmp-install"
393
404
394
405
RUST_PACKAGE_NAME=rust-nightly
@@ -439,19 +450,7 @@ then
439
450
err " failed to unpack installer"
440
451
fi
441
452
442
- MAYBE_UNINSTALL=
443
- if [ -n " ${CFG_UNINSTALL} " ]
444
- then
445
- MAYBE_UNINSTALL=" --uninstall"
446
- fi
447
-
448
- MAYBE_PREFIX=
449
- if [ -n " ${CFG_PREFIX} " ]
450
- then
451
- MAYBE_PREFIX=" --prefix=${CFG_PREFIX} "
452
- fi
453
-
454
- sh " ${RUST_LOCAL_INSTALL_SCRIPT} " " ${MAYBE_UNINSTALL} " " ${MAYBE_PREFIX} "
453
+ sh " ${RUST_LOCAL_INSTALL_SCRIPT} " " ${CFG_INSTALL_FLAGS} "
455
454
if [ $? -ne 0 ]
456
455
then
457
456
rm -Rf " ${CFG_TMP_DIR} "
@@ -466,7 +465,7 @@ if [ -z "${CFG_DISABLE_CARGO}" ]; then
466
465
err " failed to unpack cargo installer"
467
466
fi
468
467
469
- sh " ${CARGO_LOCAL_INSTALL_SCRIPT} " " ${MAYBE_UNINSTALL} " " ${MAYBE_PREFIX }"
468
+ sh " ${CARGO_LOCAL_INSTALL_SCRIPT} " " ${CFG_INSTALL_FLAGS } "
470
469
if [ $? -ne 0 ]
471
470
then
472
471
rm -Rf " ${CFG_TMP_DIR} "
You can’t perform that action at this time.
0 commit comments