Files
uni/scripts/dev-server.sh
Michael Czechowski 9e12447528 rebuild dev and build system with single marp server
- simplify development: single marp server on port 3000 instead of 3 processes
- rename klausur to klausurfolien for better naming
- update extract script to use 00-intro.md as template when no 01-*.md exists
- update makefile and package.json for new workflow
- add comprehensive AGENTS.md guidelines
2026-02-01 18:17:51 +01:00

53 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Simplified development server for HdM slides
# Starts single Marp server for all courses
set -e
# Configuration
SLIDES_DIR="slides"
DEV_PORT=3000
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Cleanup function
cleanup() {
echo -e "\n${RED}Shutting down dev server...${NC}"
pkill -f "marp-cli.*--server" 2>/dev/null || true
exit 0
}
# Kill existing processes on our port
kill_existing() {
echo -e "${BLUE}Cleaning up existing processes...${NC}"
pkill -9 -f "marp-cli" 2>/dev/null || true
fuser -k $DEV_PORT/tcp 2>/dev/null || true
sleep 1
}
# Main
trap cleanup SIGINT SIGTERM
kill_existing
echo -e "${GREEN}Starting development server...${NC}"
echo ""
echo -e " Server: ${BLUE}http://localhost:$DEV_PORT${NC}"
echo -e " Slides: ${BLUE}$SLIDES_DIR/${NC}"
echo ""
echo -e "Available courses:"
echo -e " 223015b: ${BLUE}http://localhost:$DEV_PORT/223015b/${NC}"
echo -e " 223015c: ${BLUE}http://localhost:$DEV_PORT/223015c/${NC}"
echo ""
echo -e "Press ${RED}Ctrl+C${NC} to stop the server"
echo ""
# Start single Marp server for all slides
PORT=$DEV_PORT npx @marp-team/marp-cli --server "$SLIDES_DIR/"
# Wait for process to exit
wait