-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·36 lines (28 loc) · 892 Bytes
/
bootstrap.sh
File metadata and controls
executable file
·36 lines (28 loc) · 892 Bytes
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
#!/bin/bash
# One-time (or manual) dependency bootstrap script.
# Usage:
# ./bootstrap.sh # normal bootstrap
# ./bootstrap.sh --force # force reinstall frontend deps
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FORCE_INSTALL_FRONTEND=false
if [ "${1:-}" = "--force" ]; then
FORCE_INSTALL_FRONTEND=true
fi
echo "Bootstrapping Quant Master dependencies..."
echo "[backend] setting up virtual environment"
cd "$SCRIPT_DIR/backend"
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
echo "[frontend] installing node dependencies"
cd "$SCRIPT_DIR/frontend"
if [ "$FORCE_INSTALL_FRONTEND" = true ] || [ ! -d "node_modules" ]; then
npm install
else
echo "node_modules exists, skipping npm install (use --force to reinstall)"
fi
echo "Bootstrap complete."