-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdev-server.sh
More file actions
executable file
·52 lines (42 loc) · 1.12 KB
/
Copy pathdev-server.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.12 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
#!/bin/bash
set -e
if ! hash poetry 2> /dev/null; then
>&2 echo "Could not find poetry"
>&2 echo "See https://python-poetry.org/docs/ for installation docs"
exit 1
fi
node_version=$(node --version)
if [ "$(echo "$node_version" | grep -c -E '^v24[.]')" -ne 1 ]; then
>&2 echo Need node v24 but have "$node_version"
exit 1
fi
REPO_ROOT=$(git rev-parse --show-toplevel)
(
cd "$REPO_ROOT"/public
doc_link_target=../doc/build/html
if ! [ -h doc ]; then
>&2 echo "Creating symlink public/doc -> $doc_link_target"
ln -s "$doc_link_target" doc
else
if ! [ -L doc ]; then
>&2 echo "public/doc must be a symbolic link"
exit 1
fi
link_target=$(readlink doc)
if [ "$link_target" != "$doc_link_target" ]; then
>&2 echo "public/doc must be a symbolic link to $doc_link_target"
exit 1
fi
fi
)
(
cd "$REPO_ROOT"/doc
poetry install
poetry run make html
)
export VITE_DOCS_BASE_URL_WITHIN_APP=/doc
if [ "$1" = prod ]; then
npx vite build && exec npx vite preview
else
exec npx vite dev
fi