parent
1f80539ba1
commit
a06c4a2151
2
dnvm.ps1
2
dnvm.ps1
|
|
@ -67,7 +67,7 @@ function _WriteOut {
|
||||||
|
|
||||||
### Constants
|
### Constants
|
||||||
$ProductVersion="1.0.0"
|
$ProductVersion="1.0.0"
|
||||||
$BuildVersion="beta6-10394"
|
$BuildVersion="beta6-10395"
|
||||||
$Authors="Microsoft Open Technologies, Inc."
|
$Authors="Microsoft Open Technologies, Inc."
|
||||||
|
|
||||||
# If the Version hasn't been replaced...
|
# If the Version hasn't been replaced...
|
||||||
|
|
|
||||||
27
dnvm.sh
27
dnvm.sh
|
|
@ -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="beta6-10394"
|
_DNVM_BUILDNUMBER="beta6-10395"
|
||||||
_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"
|
||||||
|
|
@ -14,7 +14,6 @@ _DNVM_VERSION_MANAGER_NAME=".NET Version Manager"
|
||||||
_DNVM_DEFAULT_FEED="https://www.nuget.org/api/v2"
|
_DNVM_DEFAULT_FEED="https://www.nuget.org/api/v2"
|
||||||
_DNVM_DEFAULT_UNSTABLE_FEED="https://www.myget.org/F/aspnetvnext/api/v2"
|
_DNVM_DEFAULT_UNSTABLE_FEED="https://www.myget.org/F/aspnetvnext/api/v2"
|
||||||
_DNVM_UPDATE_LOCATION="https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.sh"
|
_DNVM_UPDATE_LOCATION="https://raw.githubusercontent.com/aspnet/Home/dev/dnvm.sh"
|
||||||
_DNVM_HOME_VAR_NAME="DNX_HOME"
|
|
||||||
|
|
||||||
if [ "$NO_COLOR" != "1" ]; then
|
if [ "$NO_COLOR" != "1" ]; then
|
||||||
# ANSI Colors
|
# ANSI Colors
|
||||||
|
|
@ -47,6 +46,11 @@ if [ -z "$DNX_USER_HOME" ]; then
|
||||||
eval DNX_USER_HOME="~/$_DNVM_RUNTIME_FOLDER_NAME"
|
eval DNX_USER_HOME="~/$_DNVM_RUNTIME_FOLDER_NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$DNX_HOME" ]; then
|
||||||
|
# Set to the user home value
|
||||||
|
DNX_HOME="$DNX_USER_HOME"
|
||||||
|
fi
|
||||||
|
|
||||||
_DNVM_USER_PACKAGES="$DNX_USER_HOME/runtimes"
|
_DNVM_USER_PACKAGES="$DNX_USER_HOME/runtimes"
|
||||||
_DNVM_ALIAS_DIR="$DNX_USER_HOME/alias"
|
_DNVM_ALIAS_DIR="$DNX_USER_HOME/alias"
|
||||||
_DNVM_DNVM_DIR="$DNX_USER_HOME/dnvm"
|
_DNVM_DNVM_DIR="$DNX_USER_HOME/dnvm"
|
||||||
|
|
@ -75,7 +79,7 @@ __dnvm_find_latest() {
|
||||||
printf "%b\n" "${Red}$_DNVM_COMMAND_NAME needs curl to proceed. ${RCol}" >&2;
|
printf "%b\n" "${Red}$_DNVM_COMMAND_NAME needs curl to proceed. ${RCol}" >&2;
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $platform == "mono" ]]; then
|
if [[ $platform == "mono" ]]; then
|
||||||
#dnx-mono
|
#dnx-mono
|
||||||
local packageId="$_DNVM_RUNTIME_PACKAGE_NAME-$platform"
|
local packageId="$_DNVM_RUNTIME_PACKAGE_NAME-$platform"
|
||||||
|
|
@ -161,7 +165,7 @@ __dnvm_download() {
|
||||||
printf "%b\n" "${Gre}$runtimeFullName already installed. ${RCol}"
|
printf "%b\n" "${Gre}$runtimeFullName already installed. ${RCol}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! __dnvm_has "curl"; then
|
if ! __dnvm_has "curl"; then
|
||||||
printf "%b\n" "${Red}$_DNVM_COMMAND_NAME needs curl to proceed. ${RCol}" >&2;
|
printf "%b\n" "${Red}$_DNVM_COMMAND_NAME needs curl to proceed. ${RCol}" >&2;
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -273,15 +277,15 @@ __dnvm_description() {
|
||||||
printf "%b\n" "${Yel}Current feed settings:${RCol}"
|
printf "%b\n" "${Yel}Current feed settings:${RCol}"
|
||||||
printf "%b\n" "${Cya}Default Stable:${Yel} $_DNVM_DEFAULT_FEED"
|
printf "%b\n" "${Cya}Default Stable:${Yel} $_DNVM_DEFAULT_FEED"
|
||||||
printf "%b\n" "${Cya}Default Unstable:${Yel} $_DNVM_DEFAULT_UNSTABLE_FEED"
|
printf "%b\n" "${Cya}Default Unstable:${Yel} $_DNVM_DEFAULT_UNSTABLE_FEED"
|
||||||
|
|
||||||
local dnxStableOverride="<none>"
|
local dnxStableOverride="<none>"
|
||||||
[[ -n $DNX_FEED ]] && dnxStableOverride="$DNX_FEED"
|
[[ -n $DNX_FEED ]] && dnxStableOverride="$DNX_FEED"
|
||||||
|
|
||||||
printf "%b\n" "${Cya}Current Stable Override:${Yel} $dnxStableOverride"
|
printf "%b\n" "${Cya}Current Stable Override:${Yel} $dnxStableOverride"
|
||||||
|
|
||||||
local dnxUnstableOverride="<none>"
|
local dnxUnstableOverride="<none>"
|
||||||
[[ -n $DNX_UNSTABLE_FEED ]] && dnxUnstableOverride="$DNX_UNSTABLE_FEED"
|
[[ -n $DNX_UNSTABLE_FEED ]] && dnxUnstableOverride="$DNX_UNSTABLE_FEED"
|
||||||
|
|
||||||
printf "%b\n" "${Cya}Current Unstable Override:${Yel} $dnxUnstableOverride${RCol}"
|
printf "%b\n" "${Cya}Current Unstable Override:${Yel} $dnxUnstableOverride${RCol}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
@ -406,17 +410,17 @@ dnvm()
|
||||||
elif [[ $1 == "-arch" ]]; then
|
elif [[ $1 == "-arch" ]]; then
|
||||||
local arch=$2
|
local arch=$2
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [[ $arch != "x86" && $arch != "x64" ]]; then
|
if [[ $arch != "x86" && $arch != "x64" ]]; then
|
||||||
printf "%b\n" "${Red}Architecture must be x86 or x64.${RCol}"
|
printf "%b\n" "${Red}Architecture must be x86 or x64.${RCol}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $arch == "x86" && $runtime == "coreclr" ]]; then
|
if [[ $arch == "x86" && $runtime == "coreclr" ]]; then
|
||||||
printf "%b\n" "${Red}Core CLR doesn't currently have a 32 bit build. You must use x64.${RCol}"
|
printf "%b\n" "${Red}Core CLR doesn't currently have a 32 bit build. You must use x64.${RCol}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ -n $1 ]]; then
|
elif [[ -n $1 ]]; then
|
||||||
[[ -n $versionOrAlias ]] && echo "Invalid option $1" && __dnvm_help && return 1
|
[[ -n $versionOrAlias ]] && echo "Invalid option $1" && __dnvm_help && return 1
|
||||||
local versionOrAlias=$1
|
local versionOrAlias=$1
|
||||||
|
|
@ -697,5 +701,8 @@ dnvm()
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add the home location's bin directory to the path
|
||||||
|
export PATH="$DNX_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 list default >/dev/null && $_DNVM_COMMAND_NAME use default >/dev/null || true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue