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

Source: aspnet/dnvm@0375986321
This commit is contained in:
ASP.NET Push Bot 2015-09-08 15:10:36 -07:00 committed by unknown
parent 9992c4ad36
commit dd9ad89c51
2 changed files with 32 additions and 22 deletions

View File

@ -67,7 +67,7 @@ function _WriteOut {
### Constants
$ProductVersion="1.0.0"
$BuildVersion="beta8-15510"
$BuildVersion="beta8-15511"
$Authors="Microsoft Open Technologies, Inc."
# If the Version hasn't been replaced...
@ -400,8 +400,12 @@ function Get-RuntimeAliasOrRuntimeInfo(
if(Test-Path $aliasPath) {
$BaseName = Get-Content $aliasPath
$Architecture = Get-PackageArch $BaseName
$Runtime = Get-PackageRuntime $BaseName
if(!$Architecture) {
$Architecture = Get-PackageArch $BaseName
}
if(!$Runtime) {
$Runtime = Get-PackageRuntime $BaseName
}
$Version = Get-PackageVersion $BaseName
$OS = Get-PackageOS $BaseName
}
@ -1550,7 +1554,7 @@ function dnvm-use {
return;
}
$runtimeInfo = Get-RuntimeAliasOrRuntimeInfo -Version:$VersionOrAlias -Architecture:$Architecture -Runtime:$Runtime -OS:$OS
$runtimeInfo = Get-RuntimeAliasOrRuntimeInfo -Version:$VersionOrAlias -Architecture:$Architecture -Runtime:$Runtime -OS:$OS
$runtimeFullName = $runtimeInfo.RuntimeName
$runtimeBin = Get-RuntimePath $runtimeFullName
if ($runtimeBin -eq $null) {

42
dnvm.sh
View File

@ -2,7 +2,7 @@
# Source this file from your .bash-profile or script to use
# "Constants"
_DNVM_BUILDNUMBER="beta8-15510"
_DNVM_BUILDNUMBER="beta8-15511"
_DNVM_AUTHORS="Microsoft Open Technologies, Inc."
_DNVM_RUNTIME_PACKAGE_NAME="dnx"
_DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
@ -333,24 +333,30 @@ __dnvm_requested_version_or_alias() {
else
if [ -e "$_DNVM_ALIAS_DIR/$versionOrAlias.alias" ]; then
local runtimeFullName=$(cat "$_DNVM_ALIAS_DIR/$versionOrAlias.alias")
echo "$runtimeFullName"
else
local pkgVersion=$versionOrAlias
local pkgArchitecture="x64"
local pkgSystem=$os
if [[ -z $runtime || "$runtime" == "mono" ]]; then
echo "$_DNVM_RUNTIME_PACKAGE_NAME-mono.$pkgVersion"
else
if [ "$arch" != "" ]; then
local pkgArchitecture="$arch"
fi
if [ "$os" == "" ]; then
local pkgSystem=$(__dnvm_current_os)
fi
echo "$_DNVM_RUNTIME_PACKAGE_NAME-$runtime-$pkgSystem-$pkgArchitecture.$pkgVersion"
if [[ ! -n "$runtime" && ! -n "$arch" ]]; then
echo "$runtimeFullName"
return
fi
local pkgVersion=$(__dnvm_package_version "$runtimeFullName")
fi
if [[ ! -n "$pkgVersion" ]]; then
local pkgVersion=$versionOrAlias
fi
local pkgArchitecture="x64"
local pkgSystem=$os
if [[ -z $runtime || "$runtime" == "mono" ]]; then
echo "$_DNVM_RUNTIME_PACKAGE_NAME-mono.$pkgVersion"
else
if [ "$arch" != "" ]; then
local pkgArchitecture="$arch"
fi
if [ "$os" == "" ]; then
local pkgSystem=$(__dnvm_current_os)
fi
echo "$_DNVM_RUNTIME_PACKAGE_NAME-$runtime-$pkgSystem-$pkgArchitecture.$pkgVersion"
fi
fi
}