Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordotnet-maestro <@dotnet-maestro>2019-05-07 16:24:31 +0300
committerMarek Safar <marek.safar@gmail.com>2019-05-07 19:25:43 +0300
commit143ab197941a5ae5495f54ec2b58c03b14fdd0d0 (patch)
tree0d25d3d8e8d315db7460e57b9c4a2d9bf9db9bab /eng/common/dotnet-install.sh
parentd52b052e40aed8ad9cb98eeb42c6fc9f5b21fde5 (diff)
Update dependencies from https://github.com/dotnet/arcade build 20190506.12
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19256.12
Diffstat (limited to 'eng/common/dotnet-install.sh')
-rw-r--r--eng/common/dotnet-install.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh
new file mode 100644
index 000000000..c3072c958
--- /dev/null
+++ b/eng/common/dotnet-install.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+source="${BASH_SOURCE[0]}"
+# resolve $source until the file is no longer a symlink
+while [[ -h "$source" ]]; do
+ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+ source="$(readlink "$source")"
+ # if $source was a relative symlink, we need to resolve it relative to the path where the
+ # symlink file was located
+ [[ $source != /* ]] && source="$scriptroot/$source"
+done
+scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+
+version='Latest'
+architecture=''
+runtime='dotnet'
+while [[ $# > 0 ]]; do
+ opt="$(echo "$1" | awk '{print tolower($0)}')"
+ case "$opt" in
+ -version|-v)
+ shift
+ version="$1"
+ ;;
+ -architecture|-a)
+ shift
+ architecture="$1"
+ ;;
+ -runtime|-r)
+ shift
+ runtime="$1"
+ ;;
+ *)
+ echo "Invalid argument: $1"
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+. "$scriptroot/tools.sh"
+dotnetRoot="$repo_root/.dotnet"
+InstallDotNet $dotnetRoot $version "$architecture" $runtime true || {
+ local exit_code=$?
+ echo "dotnet-install.sh failed (exit code '$exit_code')." >&2
+ ExitWithExitCode $exit_code
+}
+
+ExitWithExitCode 0