-
Notifications
You must be signed in to change notification settings - Fork 69
/
build
executable file
·46 lines (39 loc) · 1 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/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 git > /dev/null; then
git submodule status | while read line; do
if [ "$(echo $line | cut -b1)" == "-" ]; then
pieces=( $line )
git submodule update --init ${pieces[1]}
echo ""
fi
done
else
echo "error(1): Could not find 'git'; please install the Git CLI" 2>&1
exit 1
fi
if which dotnet > /dev/null; then
if [ $(dotnet --version | cut -d. -f1) -lt 8 ]; then
echo "error(1): .NET SDK version $(dotnet --version) is too low; please install 8.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