forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·40 lines (33 loc) · 880 Bytes
/
bootstrap.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
#!/usr/bin/env bash
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace
set -eu
YELLOW="\033[93m"
BLUE="\033[34m"
GREEN="\033[32m"
BOLD="\033[1m"
RESET="\033[0m"
cd "$(dirname "$0")"
CMD=${1:-}
if [ "$CMD" = "clean" ]; then
git clean -fdx
exit 0
elif [ "$CMD" = "full" ]; then
yarn install --immutable
yarn build
exit 0
elif [[ -n "$CMD" && "$CMD" != "fast" ]]; then
echo "Unknown command: $CMD"
exit 1
fi
# Fast build does not delete everything first.
# It regenerates all generated code, then performs an incremental tsc build.
echo -e "${BLUE}${BOLD}Attempting fast incremental build...${RESET}"
echo
yarn install --immutable
if ! yarn build:fast; then
echo -e "${YELLOW}${BOLD}Incremental build failed for some reason, attempting full build...${RESET}"
echo
yarn build
fi
echo
echo -e "${GREEN}Yarn project successfully built!${RESET}"