forked from xunit/xunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·33 lines (27 loc) · 811 Bytes
/
build
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
#!/usr/bin/env bash
set -euo pipefail
PUSHED=0
cleanup () {
if [[ $PUSHED == 1 ]]; then
popd >/dev/null
PUSHED=0
fi
}
trap cleanup EXIT ERR INT TERM
if which dotnet > /dev/null; then
if [ $(dotnet --version | cut -d. -f1) -lt 7 ]; then
echo "error(1): .NET SDK version $(dotnet --version) is too low; please install 7.0 or later"
exit 1
fi
if [ `uname -o` = Msys ] || which mono > /dev/null ; then
pushd $( cd "$(dirname "$0")" ; pwd -P ) >/dev/null
PUSHED=1
dotnet run --project tools/builder --no-launch-profile -- "$@"
else
echo "error(1): Could not find 'mono'; please install Mono" 2>&1
exit 1
fi
else
echo "error(1): Could not find 'dotnet'; please install the .NET Core SDK" 2>&1
exit 1
fi