forked from ionide/Forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·70 lines (60 loc) · 1.69 KB
/
build.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set -eu
set -o pipefail
cd `dirname $0`
PAKET_BOOTSTRAPPER_EXE=.paket/paket.bootstrapper.exe
PAKET_EXE=.paket/paket.exe
FAKE_EXE=packages/FAKE/tools/FAKE.exe
FSIARGS=""
OS=${OS:-"unknown"}
if [[ "$OS" != "Windows_NT" ]]
then
FSIARGS="--fsiargs -d:MONO"
fi
function run() {
if [[ "$OS" != "Windows_NT" ]]
then
mono "$@"
else
"$@"
fi
}
function yesno() {
# NOTE: Defaults to NO
read -p "$1 [y/N] " ynresult
case "$ynresult" in
[yY]*) true ;;
*) false ;;
esac
}
set +e
run $PAKET_BOOTSTRAPPER_EXE
bootstrapper_exitcode=$?
set -e
if [[ "$OS" != "Windows_NT" ]] &&
[ $bootstrapper_exitcode -ne 0 ] &&
[ $(certmgr -list -c Trust | grep X.509 | wc -l) -le 1 ] &&
[ $(certmgr -list -c -m Trust | grep X.509 | wc -l) -le 1 ]
then
echo "Your Mono installation has no trusted SSL root certificates set up."
echo "This will result in the Paket bootstrapper failing to download Paket"
echo "because Github's SSL certificate can't be verified. You can probably"
echo "fix this by installing the latest mono-complete package, which will"
echo "automatically sync certificates after installation. If that doesn't"
echo "work and you are using mono >= 3.12.0 then you need to run:"
echo ""
echo " cert-sync /path/to/certs"
echo ""
echo "For more information see:"
echo ""
echo "http://www.mono-project.com/docs/about-mono/releases/3.12.0/#cert-sync"
echo ""
echo "If you are using an older version of mono, you need to run:"
echo ""
echo " mozroots --import --sync"
exit 1
fi
run $PAKET_EXE restore
[ ! -e build.fsx ] && run $PAKET_EXE update
[ ! -e build.fsx ] && run $FAKE_EXE init.fsx
run $FAKE_EXE "$@" $FSIARGS build.fsx