Skip to content

Commit 953d582

Browse files
ASP.NET Push Botunknown
authored andcommitted
⬆️ dnvm.ps1, dnvm.cmd, dnvm.sh
Source: aspnet/dnvm@ba2fce9
1 parent 0d52700 commit 953d582

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

dnvm.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function _WriteOut {
6767

6868
### Constants
6969
$ProductVersion="1.0.0"
70-
$BuildVersion="beta8-15506"
70+
$BuildVersion="beta8-15507"
7171
$Authors="Microsoft Open Technologies, Inc."
7272

7373
# If the Version hasn't been replaced...

dnvm.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Source this file from your .bash-profile or script to use
33

44
# "Constants"
5-
_DNVM_BUILDNUMBER="beta8-15506"
5+
_DNVM_BUILDNUMBER="beta8-15507"
66
_DNVM_AUTHORS="Microsoft Open Technologies, Inc."
77
_DNVM_RUNTIME_PACKAGE_NAME="dnx"
88
_DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
@@ -201,7 +201,12 @@ __dnvm_update_self() {
201201
if [ ! -e $dnvmFileLocation ]; then
202202
local formattedDnvmFileLocation=`(echo $dnvmFileLocation | sed s=$HOME=~=g)`
203203
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}"
205210
return 1
206211
fi
207212
printf "%b\n" "${Cya}Downloading dnvm.sh from $_DNVM_UPDATE_LOCATION ${RCol}"
@@ -531,7 +536,7 @@ dnvm()
531536
shift
532537

533538
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}"
535540
return 1
536541
fi
537542
elif [[ $1 == "-g" || $1 == "-global" ]]; then
@@ -717,14 +722,14 @@ dnvm()
717722
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"
718723
fi
719724
;;
720-
"exec")
725+
"exec")
721726
(
722727
PATH=$(__dnvm_strip_path "$PATH" "/bin")
723728
PATH=$(__dnvm_prepend_path "$PATH" "$runtimeBin")
724729
$@
725730
)
726731
;;
727-
"use")
732+
"use")
728733
echo "Adding" $runtimeBin "to process PATH"
729734

730735
PATH=$(__dnvm_strip_path "$PATH" "/bin")

0 commit comments

Comments
 (0)