forked from Start9Labs/start-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserve.sh
More file actions
executable file
·35 lines (28 loc) · 865 Bytes
/
serve.sh
File metadata and controls
executable file
·35 lines (28 loc) · 865 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
#!/bin/bash
set -e
cd "$(dirname "$0")"
# Build widget if necessary
cd widget
if [ ! -d "node_modules" ] || [ "package-lock.json" -nt "node_modules" ]; then
echo "Installing widget dependencies..."
npm ci
fi
if [ ! -d "dist" ] || [ -n "$(find src -newer dist -print -quit 2>/dev/null)" ]; then
echo "Building widget..."
npm run build
fi
cd ..
# Build all books
./build.sh
# Serve docs directory
BOOK="${1:-start-os}"
echo "Serving from docs/ at http://localhost:3000"
echo " Landing: http://localhost:3000/"
echo " StartOS: http://localhost:3000/start-os/"
echo " StartTunnel: http://localhost:3000/start-tunnel/"
echo " Packaging: http://localhost:3000/packaging/"
echo ""
echo "To live-reload a single book while editing, run in another terminal:"
echo " cd $BOOK && mdbook serve -p 3001"
echo ""
python3 -m http.server 3000 -d docs