|
2 | 2 | # Source this file from your .bash-profile or script to use
|
3 | 3 |
|
4 | 4 | # "Constants"
|
5 |
| -_DNVM_BUILDNUMBER="beta8-15506" |
| 5 | +_DNVM_BUILDNUMBER="beta8-15507" |
6 | 6 | _DNVM_AUTHORS="Microsoft Open Technologies, Inc."
|
7 | 7 | _DNVM_RUNTIME_PACKAGE_NAME="dnx"
|
8 | 8 | _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
|
@@ -201,7 +201,12 @@ __dnvm_update_self() {
|
201 | 201 | if [ ! -e $dnvmFileLocation ]; then
|
202 | 202 | local formattedDnvmFileLocation=`(echo $dnvmFileLocation | sed s=$HOME=~=g)`
|
203 | 203 | local formattedDnvmHome=`(echo $_DNVM_DNVM_DIR | sed s=$HOME=~=g)`
|
204 |
| - printf "%b\n" "${Red}$formattedDnvmFileLocation doesn't exist. This command assumes you have installed dnvm in the usual location and are trying to update it. If you want to use update-self then dnvm.sh should be sourced from $formattedDnvmHome ${RCol}" |
| 204 | + local bashSourceLocation=${BASH_SOURCE} |
| 205 | + local scriptLocation=$bashSourceLocation |
| 206 | + if [ -z "${bashSourceLocation}" ]; then |
| 207 | + local scriptLocation=${(%):-%x} |
| 208 | + fi |
| 209 | + printf "%b\n" "${Red}$formattedDnvmFileLocation doesn't exist. This command assumes you have installed dnvm in the usual location and are trying to update it. If you want to use update-self then dnvm.sh should be sourced from $formattedDnvmHome. dnvm is currently sourced from $scriptLocation ${RCol}" |
205 | 210 | return 1
|
206 | 211 | fi
|
207 | 212 | printf "%b\n" "${Cya}Downloading dnvm.sh from $_DNVM_UPDATE_LOCATION ${RCol}"
|
@@ -531,7 +536,7 @@ dnvm()
|
531 | 536 | shift
|
532 | 537 |
|
533 | 538 | if [[ $arch != "x86" && $arch != "x64" ]]; then
|
534 |
| - printf "%b\n" "${Red}Architecture must be x86 or x64.${RCol}" |
| 539 | + printf "%b\n" "${Red}Architecture must be x86 or x64.${RCol}" |
535 | 540 | return 1
|
536 | 541 | fi
|
537 | 542 | elif [[ $1 == "-g" || $1 == "-global" ]]; then
|
@@ -717,14 +722,14 @@ dnvm()
|
717 | 722 | echo "Cannot find $_DNVM_RUNTIME_SHORT_NAME in $runtimeBin. It may have been corrupted. Use '$_DNVM_COMMAND_NAME install $versionOrAlias -f' to attempt to reinstall it"
|
718 | 723 | fi
|
719 | 724 | ;;
|
720 |
| - "exec") |
| 725 | + "exec") |
721 | 726 | (
|
722 | 727 | PATH=$(__dnvm_strip_path "$PATH" "/bin")
|
723 | 728 | PATH=$(__dnvm_prepend_path "$PATH" "$runtimeBin")
|
724 | 729 | $@
|
725 | 730 | )
|
726 | 731 | ;;
|
727 |
| - "use") |
| 732 | + "use") |
728 | 733 | echo "Adding" $runtimeBin "to process PATH"
|
729 | 734 |
|
730 | 735 | PATH=$(__dnvm_strip_path "$PATH" "/bin")
|
|
0 commit comments