diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2019-12-11 23:01:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 23:01:58 +0300 |
commit | f5957b1bae3028fd3854230164d9f18b40c7193f (patch) | |
tree | 0638593a927725fcf4886916411e67e5d486bd70 /dotnet.sh | |
parent | 071da4c41aa808c949a773b92dca6f88de9d11f3 (diff) |
Move dotnet.cmd/sh helper scripts into the repo root (#672)
* Move dotnet helper scripts to repo root
* Don't swallow InitializeDotNetCli output
* Use temporary file to store sdk location
To avoid a nested process chain in which the inner process then invokes
the host, we instead create a temporary file to store the sdk location.
Diffstat (limited to 'dotnet.sh')
-rwxr-xr-x | dotnet.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dotnet.sh b/dotnet.sh new file mode 100755 index 00000000000..a612ebac1ce --- /dev/null +++ b/dotnet.sh @@ -0,0 +1,27 @@ +#!/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 )" + +# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism +export DOTNET_MULTILEVEL_LOOKUP=0 + +# Disable first run since we want to control all package sources +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + +source $scriptroot/eng/common/tools.sh + +InitializeDotNetCli true # Install +__dotnetDir=${_InitializeDotNetCli} + +dotnetPath=${__dotnetDir}/dotnet +${dotnetPath} "$@" |