3 source="${BASH_SOURCE[0]}"
4 # resolve $source until the file is no longer a symlink
5 while [[ -h "$source" ]]; do
6 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
7 source="$(readlink "$source")"
8 # if $source was a relative symlink, we need to resolve it relative to the path where the
9 # symlink file was located
10 [[ $source != /* ]] && source="$scriptroot/$source"
12 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
18 runtimeSourceFeedKey
=''
19 while [[ $# > 0 ]]; do
20 opt
="$(echo "$1" | awk '{print tolower($0)}')"
36 runtimeSourceFeed
="$1"
38 -runtimesourcefeedkey)
40 runtimeSourceFeedKey
="$1"
43 echo "Invalid argument: $1"
50 # Use uname to determine what the CPU is.
52 # Some Linux platforms report unknown for platform, but the arch for machine.
53 if [[ "$cpuname" == "unknown" ]]; then
71 echo "Unknown CPU $cpuname detected, treating it as x64"
76 .
"$scriptroot/tools.sh"
77 dotnetRoot
="$repo_root/.dotnet"
78 if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
79 dotnetRoot
="$dotnetRoot/$architecture"
82 InstallDotNet
$dotnetRoot $version "$architecture" $runtime true
$runtimeSourceFeed $runtimeSourceFeedKey ||
{
84 echo "dotnet-install.sh failed (exit code '$exit_code')." >&2
85 ExitWithExitCode
$exit_code