⬆️ dnvm.ps1, dnvm.cmd, dnvm.sh

Source: aspnet/dnvm@c964d0fceb
This commit is contained in:
ASP.NET Push Bot 2015-09-08 13:54:56 -07:00 committed by unknown
parent 8c3dd150b5
commit 9992c4ad36
2 changed files with 10 additions and 8 deletions

View File

@ -67,7 +67,7 @@ function _WriteOut {
### Constants ### Constants
$ProductVersion="1.0.0" $ProductVersion="1.0.0"
$BuildVersion="beta8-15509" $BuildVersion="beta8-15510"
$Authors="Microsoft Open Technologies, Inc." $Authors="Microsoft Open Technologies, Inc."
# If the Version hasn't been replaced... # If the Version hasn't been replaced...

16
dnvm.sh
View File

@ -2,7 +2,7 @@
# Source this file from your .bash-profile or script to use # Source this file from your .bash-profile or script to use
# "Constants" # "Constants"
_DNVM_BUILDNUMBER="beta8-15509" _DNVM_BUILDNUMBER="beta8-15510"
_DNVM_AUTHORS="Microsoft Open Technologies, Inc." _DNVM_AUTHORS="Microsoft Open Technologies, Inc."
_DNVM_RUNTIME_PACKAGE_NAME="dnx" _DNVM_RUNTIME_PACKAGE_NAME="dnx"
_DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment" _DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
@ -778,7 +778,7 @@ dnvm()
local name="$1" local name="$1"
if [[ $# == 1 ]]; then if [[ $# == 1 ]]; then
[[ ! -e "$_DNVM_ALIAS_DIR/$name.alias" ]] && echo "There is no alias called '$name'" && return [[ ! -e "$_DNVM_ALIAS_DIR/$name.alias" ]] && echo "There is no alias called '$name'" && return 1
cat "$_DNVM_ALIAS_DIR/$name.alias" cat "$_DNVM_ALIAS_DIR/$name.alias"
echo "" echo ""
return return
@ -832,10 +832,12 @@ dnvm()
local runtimes="" local runtimes=""
for location in `echo $DNX_HOME | tr ":" "\n"`; do for location in `echo $DNX_HOME | tr ":" "\n"`; do
location+="/runtimes" location+="/runtimes"
local oruntimes="$(find $location -name "$searchGlob" \( -type d -or -type l \) -prune -exec basename {} \;)" if [ -d "$location" ]; then
for v in `echo $oruntimes | tr "\n" " "`; do local oruntimes="$(find $location -name "$searchGlob" \( -type d -or -type l \) -prune -exec basename {} \;)"
runtimes+="$v:$location"$'\n' for v in `echo $oruntimes | tr "\n" " "`; do
done runtimes+="$v:$location"$'\n'
done
fi
done done
[[ -z $runtimes ]] && echo 'No runtimes installed. You can run `dnvm install latest` or `dnvm upgrade` to install a runtime.' && return [[ -z $runtimes ]] && echo 'No runtimes installed. You can run `dnvm install latest` or `dnvm upgrade` to install a runtime.' && return
@ -939,4 +941,4 @@ dnvm()
[[ ":$PATH:" != *":$DNX_USER_HOME/bin:"* ]] && export PATH="$DNX_USER_HOME/bin:$PATH" [[ ":$PATH:" != *":$DNX_USER_HOME/bin:"* ]] && export PATH="$DNX_USER_HOME/bin:$PATH"
# Generate the command function using the constant defined above. # Generate the command function using the constant defined above.
$_DNVM_COMMAND_NAME list default >/dev/null && $_DNVM_COMMAND_NAME use default >/dev/null || true $_DNVM_COMMAND_NAME alias default >/dev/null && $_DNVM_COMMAND_NAME use default >/dev/null || true