-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathdogfood.sh
executable file
·39 lines (29 loc) · 1.48 KB
/
dogfood.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
scriptroot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$scriptroot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
scriptroot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
. "$scriptroot/common/tools.sh"
. "$scriptroot/configure-toolset.sh"
InitializeToolset
. "$scriptroot/restore-toolset.sh"
ReadGlobalVersion "dotnet"
dotnet_sdk_version=$_ReadGlobalVersion
export SDK_REPO_ROOT="$repo_root"
testDotnetRoot="$artifacts_dir/bin/redist/$configuration/dotnet"
testDotnetVersion=$(ls $testDotnetRoot/sdk)
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR="$testDotnetRoot/sdk/$testDotnetVersion/Sdks"
export TestDotnetSdkHash=$(head -1 "$testDotnetRoot/sdk/$testDotnetVersion/.version")
export MicrosoftNETBuildExtensionsTargets="$artifacts_dir/bin/$configuration/Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets"
export PATH=$testDotnetRoot:$PATH
export DOTNET_ROOT=$testDotnetRoot
testDotnetSdkCurrentHash = git -c $SDK_REPO_ROOT rev-parse HEAD
hasGitChanges = $testDotnetSdkCurrentHash != $TestDotnetSdkHash
if [$hasGitChanges]; then
export PS1="\x1b[0;35m(dotnet dogfood*)\x1b[0m $PS1"
else
export PS1="\x1b[0;35m(dotnet dogfood)\x1b[0m $PS1"
fi