forked from Zaid-Ajaj/Feliz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
48 lines (38 loc) · 897 Bytes
/
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
#!/usr/bin/env bash
set -eu
cd "$(dirname "$0")"
DOTNET_EXE=dotnet.exe
PAKET_EXE=$DOTNET_EXE paket
FAKE_EXE=packages/build/FAKE/tools/FAKE.exe
FSIARGS=""
FSIARGS2=""
OS=${OS:-"unknown"}
if [ "$OS" != "Windows_NT" ]
then
# Can't use FSIARGS="--fsiargs -d:MONO" in zsh, so split it up
# (Can't use arrays since dash can't handle them)
FSIARGS="--fsiargs"
FSIARGS2="-d:MONO"
fi
run() {
if [ "$OS" != "Windows_NT" ]
then
echo "Running on linux/macs => using Mono"
mono "$@"
else
"$@"
fi
}
echo "Executing Dotnet..."
run $DOTNET_EXE tool restore
echo "Executing Paket..."
FILE='paket.lock'
if [ -f $FILE ]; then
echo "paket.lock file found, restoring packages..."
run $PAKET_EXE restore
else
echo "paket.lock was not found, installing packages..."
run $PAKET_EXE install
fi
echo "Executing FAKE..."
run $FAKE_EXE "$@" $FSIARGS $FSIARGS2 build.fsx