This repository has been archived on 2026-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
Ravenous-LaTeX/build.sh

69 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Script Configuration
URL="https://proxy.dandaedre.com/gitea/Ravenous/podman_ravenous"
CONTAINER_IMAGE="localhost/ravenous-podman:latest"
print_error() {
echo "Error: $1" >&2
echo "Please check the setup at:" >&2
echo "$URL" >&2
}
# --- Prerequisites Check ---
# 1. Check if Podman is installed and in PATH
if ! command -v podman &> /dev/null; then
print_error "Podman is not installed."
exit 1
fi
# 2. Check if the specific container image exists locally
# (Using 'image inspect' to verify exact match)
if ! podman image inspect "$CONTAINER_IMAGE" > /dev/null 2>&1; then
print_error "Container image '$CONTAINER_IMAGE' is not installed."
exit 1
fi
echo "--- Prerequisites met ---"
# --- Build Logic Selection ---
MODE="${1:-simple}" # Default to simple if no argument provided
case "$MODE" in
--full | full)
echo ">>> Executing FULL build sequence..."
# Podman Run: tablegen -e all (Note: No tty or rm flags here per your spec,
# though usually recommended. Keeping exact input commands.)
podman run --rm -v "$(pwd)":/workspace "$CONTAINER_IMAGE" tablegen -e all
mkdir -p ~/.local/share/fonts/
mkdir -p ./Images/Radar/
cp ./Ressources/lmroman8-regular.ttf ~/.local/share/fonts/
podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" graphs load
podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" graphs gen
podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -N Ravenous.tex
podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -t glossaries -N Ravenous.tex
podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -N Ravenous.tex
;;
*) # Defaults to Simple Build
echo ">>> Executing SIMPLE build..."
podman run --rm --tty -v "$(pwd)":/workspace "$CONTAINER_IMAGE" make -N Ravenous.tex
if [ $? -eq 0 ]; then
echo "--- Build Completed Successfully ---"
else
exit 1 # Propagate error code from the last command in simple mode
fi
esac
exit 0