-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·56 lines (48 loc) · 2.06 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·56 lines (48 loc) · 2.06 KB
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
#!/bin/bash
# Clone all sub-repos into this workspace after checking out the management repo.
# Run once from the webvpython directory.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
clone_if_missing() {
local dir=$1
local url=$2
if [ -d "$dir/.git" ]; then
echo " $dir — already present, skipping"
else
echo " Cloning $dir..."
git clone "$url" "$dir"
fi
}
echo "=== Setting up webvpython workspace ==="
clone_if_missing flaskHost git@github.com:vpython/flaskHost.git
clone_if_missing rsWVPRunner git@github.com:vpython/rsWVPRunner.git
clone_if_missing wmWVPRunner git@github.com:vpython/wmWVPRunner.git
clone_if_missing webVPythonDocsHome git@github.com:vpython/webVPythonDocsHome.git
clone_if_missing glowscript git@github.com:vpython/glowscript.git
echo ""
echo "=== Post-clone setup ==="
echo " wmWVPRunner: installing npm dependencies..."
(cd wmWVPRunner && npm install)
echo " rsWVPRunner: installing build-tools dependencies..."
if [ -f rsWVPRunner/build-tools/Uglify-ES/uglify-es/package.json ]; then
(cd rsWVPRunner/build-tools/Uglify-ES/uglify-es && npm install)
fi
echo " webVPythonDocsHome: creating Python venv..."
# A venv is not relocatable: its console-script shebangs bake in an absolute
# interpreter path, so a .venv copied/moved from another location (or another
# machine) is broken even though .venv/bin/python may still resolve. Detect that
# by actually running the tool do_build.sh uses, and rebuild if it fails — don't
# blindly skip on mere directory existence.
DOCS_VENV=webVPythonDocsHome/.venv
if [ -d "$DOCS_VENV" ] && ! "$DOCS_VENV/bin/sphinx-build" --version >/dev/null 2>&1; then
echo " existing .venv is broken (stale path after a move?) — rebuilding"
rm -rf "$DOCS_VENV"
fi
if [ ! -d "$DOCS_VENV" ]; then
(cd webVPythonDocsHome && python3 -m venv .venv && .venv/bin/pip install -r requirements.txt)
else
echo " .venv already present and working, skipping"
fi
echo ""
echo "=== Done. See README.md for serve and deploy commands. ==="