forked from microsoft/VirtualClient
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-restore.sh
48 lines (40 loc) · 837 Bytes
/
build-restore.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
#!/bin/bash
if [ "${1,,}" == "/?" ] || [ "${1,,}" == "-?" ] || [ "${1,,}" == "--help" ]; then
Usage
fi
ExitCode=0
echo ""
echo "[Restoring NuGet Packages]"
echo "--------------------------------------------------"
dotnet restore "$(dirname "$0")/src/VirtualClient/VirtualClient.sln" "$1"
result=$?
if [ $result -ne 0 ]; then
Error
fi
End
Usage() {
echo ""
echo "Usage:"
echo "---------------------"
echo "$0 [--interactive]"
echo ""
echo "Examples:"
echo "---------------------"
echo "# Restore NuGet packages for all projects"
echo "$0"
echo ""
echo "# Restore, allowing user to provide credentials"
echo "$0 --interactive"
Finish
}
Error() {
ExitCode=$?
End
}
End() {
echo "Restore Stage Exit Code: $ExitCode"
Finish
}
Finish() {
exit $ExitCode
}