Prepare macOS package and improve output handling

This commit is contained in:
2026-08-09 12:09:08 +02:00
parent eb915333f0
commit 355ea3e509
36 changed files with 211 additions and 9519 deletions
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
set -u
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
pause_on_exit() {
printf '\nPress Return to close this window...'
read -r _
}
trap pause_on_exit EXIT
fail() {
printf '\nError: %s\n' "$1" >&2
exit 1
}
cd "$SCRIPT_DIR" || fail "Could not open the project directory."
[ -f ".venv/bin/activate" ] || fail \
"The virtual environment is missing. Run install.command first."
# shellcheck disable=SC1091
. ".venv/bin/activate"
printf 'Enter the radioeins Top-100 overview URL:\n> '
IFS= read -r OVERVIEW_URL
[ -n "$OVERVIEW_URL" ] || fail "The URL must not be empty."
OUTPUT_DIR="$(python -c 'import sys; from radioeins_top100 import derive_output_dir; print(derive_output_dir(sys.argv[1]).resolve())' "$OVERVIEW_URL")" || fail \
"Could not determine the output directory."
printf '\nStarting evaluation...\n\n'
python radioeins_top100.py "$OVERVIEW_URL"
STATUS=$?
printf '\nOutput directory: %s\n' "$OUTPUT_DIR"
if [ "$STATUS" -eq 0 ]; then
printf 'Evaluation completed successfully.\n'
else
printf 'Evaluation finished with errors (exit code %s).\n' "$STATUS" >&2
fi
exit "$STATUS"