-
Notifications
You must be signed in to change notification settings - Fork 378
/
bootstrap.sh
executable file
·67 lines (57 loc) · 1.63 KB
/
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
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
#!/bin/bash
set -e
export CLEAN=$1
# Remove all untracked files and directories.
if [ -n "$CLEAN" ]; then
if [ "$CLEAN" = "clean" ]; then
echo "WARNING: This will erase *all* untracked files, including hooks and submodules."
echo -n "Continue? [y/n] "
read user_input
if [ "$user_input" != "y" ] && [ "$user_input" != "Y" ]; then
exit 1
fi
rm -rf .git/hooks/*
git clean -fd
for SUBMODULE in $(git config --file .gitmodules --get-regexp path | awk '{print $2}'); do
rm -rf $SUBMODULE
done
git submodule update --init --recursive
exit 0
else
echo "Unknown command: $CLEAN"
exit 1
fi
fi
git submodule update --init --recursive
if [ ! -f ~/.nvm/nvm.sh ]; then
echo "Nvm not found at ~/.nvm"
exit 1
fi
\. ~/.nvm/nvm.sh
nvm install
# Until we push .yarn/cache, we still need to install.
cd yarn-project
yarn install --immutable
cd ..
# We only bootstrap projects that produce artefacts needed for running end-to-end tests and frontends.
# aztec-connect-cpp outputs db_cli, rollup_cli and aztec-connect.wasm.
# contracts outputs smart contract abis.
# barretenberg.js outputs a webpacked web worker.
# sdk produces a webpacked version needed by frontends.
PROJECTS=(
"aztec-connect-cpp:./bootstrap.sh db_cli rollup_cli"
"contracts:./bootstrap.sh"
"yarn-project/barretenberg.js:./bootstrap.sh"
"yarn-project/sdk:yarn build"
)
for E in "${PROJECTS[@]}"; do
ARR=(${E//:/ })
DIR=${ARR[0]}
COMMAND=${ARR[@]:1}
echo "Bootstrapping $DIR: $COMMAND"
pushd $DIR > /dev/null
$COMMAND
popd > /dev/null
done
echo
echo "Success! You could now run e.g.: ./scripts/tmux-splits e2e_browser"