This commit is contained in:
2026-05-31 16:16:51 +07:00
commit 41823dcbf8
4 changed files with 468 additions and 0 deletions
Executable
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Create/use .venv, install deps, run extract.py. Usage: ./run.sh [pdf] [-o out/dir]
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
VENV="$ROOT/.venv"
PY="$VENV/bin/python"
PIP="$VENV/bin/pip"
if [[ ! -d "$VENV" ]]; then
echo "Creating venv at $VENV ..."
python3 -m venv "$VENV"
fi
echo "Installing dependencies ..."
"$PIP" install -q -r "$ROOT/requirements.txt"
if [[ $# -eq 0 ]]; then
set -- "$ROOT/RealTek-r8169.pdf"
fi
echo "Running extract.py $*"
exec "$PY" "$ROOT/extract.py" "$@"