-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
41 lines (31 loc) · 1003 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
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
set -euo pipefail
function write_error {
echo "error(1): $1" 2>&1
exit 1
}
function guard_bin {
builtin type -P "$1" &>/dev/null || write_error "Could not find '$1'; $2"
}
guard_bin git "please install the Git CLI from (https://git-scm.com/)"
guard_bin dotnet "please install the .NET SDK from (https://dot.net/)"
guard_bin docker "please install Docker from (https://docs.docker.com/engine/install/)"
[ $(dotnet --version | cut -d. -f1) -ge 9 ] || write_error ".NET SDK version $(dotnet --version) is too low; please install version 9.0 (https://dot.net/)"
git submodule status | while read line; do
if [ "$(echo $line | cut -b1)" == "-" ]; then
pieces=( $line )
git submodule update --init ${pieces[1]}
echo ""
fi
done
PUSHED=0
cleanup () {
if [[ $PUSHED == 1 ]]; then
popd >/dev/null
PUSHED=0
fi
}
trap cleanup EXIT ERR INT TERM
pushd $( cd "$(dirname "$0")" ; pwd -P ) >/dev/null
PUSHED=1
dotnet run --project tools/builder --no-launch-profile -- "$@"