#!/bin/sh

BASE_NAME="PixelOver"

EXECUTABLE=""
for candidate in \
    "./$BASE_NAME.exe" \
    "./$BASE_NAME.x86_64" \
    "./$BASE_NAME.app/Contents/MacOS/$BASE_NAME" \
    "./$BASE_NAME"
do
    if [ -f "$candidate" ] || [ -x "$candidate" ]; then
        EXECUTABLE="$candidate"
        break
    fi
done

if [ -z "$EXECUTABLE" ]; then
    echo "Error: No matching executable found for $BASE_NAME"
    exit 1
fi

echo "exec $EXECUTABLE"
exec "$EXECUTABLE" --rendering-driver opengl3 --rendering-method gl_compatibility