#!/bin/bash # Define ANSI Color Codes RED='\033[0;31m' GREEN='\033[0;32m' BLUE='\033[0;34m' YELLOW='\033[1;33m' CYAN='\033[0;36m' NC='\033[0m' # No Color (Reset) SOURCE="./src/mathe_2_merkblatt.typ" BUILD_DIR="./build" # Check if Build Directory exists if [ ! -d "$BUILD_DIR" ]; then echo -e "${BLUE}[INFO]${NC} Creating build directory: $BUILD_DIR" mkdir -p "$BUILD_DIR" fi # Check if Source File exists if [ ! -f "$SOURCE" ]; then echo -e "${RED}[ERROR]${NC} Source file '$SOURCE' not found!" exit 1 fi echo -e "${YELLOW}Starting compilation...${NC}" # Compile Dark Mode typst compile --input dark-mode=true "$SOURCE" "${BUILD_DIR}/mathe_2_merkblatt_dark.pdf" if [ $? -eq 0 ]; then echo -e "${GREEN}[SUCCESS]${NC} Darkmode build: ${CYAN}${BUILD_DIR}/mathe_2_merkblatt_dark.pdf${NC}" else echo -e "${RED}[FAIL]${NC} Error compiling Darkmode target" fi # Compile Light Mode typst compile --input dark-mode=false "$SOURCE" "${BUILD_DIR}/mathe_2_merkblatt_light.pdf" if [ $? -eq 0 ]; then echo -e "${GREEN}[SUCCESS]${NC} Lightmode build: ${CYAN}${BUILD_DIR}/mathe_2_merkblatt_light.pdf${NC}" else echo -e "${RED}[FAIL]${NC} Error compiling Lightmode target" fi echo -e "${YELLOW}Build process finished!${NC}"