Base working for damage

This commit is contained in:
2026-10-09 23:10:40 -06:00
parent 2895be91c4
commit 3e0ad62cf2
31 changed files with 9758 additions and 67 deletions
Regular → Executable
+39 -15
View File
@@ -1,26 +1,50 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Albion Online Stats launcher for Linux and macOS.
set -eu
FOUND_PYTHON="none"
FOUND_PYTHON=""
for app in python3 python
do
if [ -x "$(command -v $app)" ]; then
FOUND_PYTHON=$app
break
for app in python3 python; do
if command -v "$app" >/dev/null 2>&1; then
if "$app" -c 'import sys; sys.exit(0 if sys.version_info[0] == 3 else 1)' >/dev/null 2>&1; then
FOUND_PYTHON="$app"
break
fi
fi
done
echo "Found python: $FOUND_PYTHON"
if [ -z "$FOUND_PYTHON" ]; then
echo "Error: python 3 was not found in the system." >&2
echo "Install it with your package manager, e.g.:" >&2
echo " Debian/Ubuntu: sudo apt install python3 python3-venv python3-pip" >&2
echo " Fedora: sudo dnf install python3 python3-pip" >&2
echo " Arch: sudo pacman -S python" >&2
exit 1
fi
echo "Creating python virtual environment"
python -m venv python_env
echo "Found python: $FOUND_PYTHON ($("$FOUND_PYTHON" --version 2>&1))"
source python_env/bin/activate
if ! "$FOUND_PYTHON" -m venv --help >/dev/null 2>&1; then
echo "Error: the python 'venv' module is not available." >&2
echo "On Debian/Ubuntu install it with: sudo apt install python3-venv" >&2
exit 1
fi
echo "Installing albion online stats"
python -m pip install aostats
# The pyaoaddons capture backend is only used on macOS now (Linux uses the
# built-in AF_PACKET decoder and has no pyaoaddons wheel requirement).
echo "Creating python virtual environment..."
"$FOUND_PYTHON" -m venv python_env
# shellcheck disable=SC1091
. ./python_env/bin/activate
echo "Installing albion online stats..."
python -m pip install --upgrade pip
python -m pip install aostats
python -m pip install --upgrade aostats
aostats
echo "Starting Albion Online Stats..."
aostats "$@"