-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·57 lines (46 loc) · 1.41 KB
/
start.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.41 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
57
#!/bin/bash
# Script to start MkDocs server with automatic dependency checking
# This script activates the virtual environment, checks/installs required packages,
# and starts the MkDocs development server
set -e # Exit on error
# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "Error: Virtual environment not found. Please create it first:"
echo " python3 -m venv venv"
exit 1
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Required packages list
REQUIRED_PACKAGES=(
"mkdocs-material"
"mkdocs-awesome-pages-plugin"
"mkdocs-glightbox"
"mkdocs-spellcheck"
"symspellpy"
)
# Check and install missing packages
echo "Checking for required packages..."
MISSING_PACKAGES=()
for package in "${REQUIRED_PACKAGES[@]}"; do
if ! pip show "$package" &> /dev/null; then
MISSING_PACKAGES+=("$package")
fi
done
if [ ${#MISSING_PACKAGES[@]} -gt 0 ]; then
echo "Installing missing packages: ${MISSING_PACKAGES[*]}"
pip install "${MISSING_PACKAGES[@]}"
else
echo "All required packages are installed."
fi
# Start MkDocs server
echo ""
echo "Starting MkDocs server..."
echo "Server will be available at http://127.0.0.1:8000"
echo "Press Ctrl+C to stop the server"
echo ""
mkdocs serve