mirror of
https://github.com/ankitects/anki.git
synced 2026-01-18 08:19:01 -05:00
30 lines
No EOL
744 B
Bash
30 lines
No EOL
744 B
Bash
#!/bin/bash
|
|
# Universal Anki launcher script
|
|
|
|
# Get the directory where this script is located (resolve symlinks)
|
|
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
|
|
|
# Determine architecture
|
|
ARCH=$(uname -m)
|
|
case "$ARCH" in
|
|
x86_64|amd64)
|
|
LAUNCHER="$SCRIPT_DIR/launcher.amd64"
|
|
;;
|
|
aarch64|arm64)
|
|
LAUNCHER="$SCRIPT_DIR/launcher.arm64"
|
|
;;
|
|
*)
|
|
echo "Error: Unsupported architecture: $ARCH"
|
|
echo "Supported architectures: x86_64, aarch64"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Check if launcher exists
|
|
if [ ! -f "$LAUNCHER" ]; then
|
|
echo "Error: Launcher not found: $LAUNCHER"
|
|
exit 1
|
|
fi
|
|
|
|
# Execute the appropriate launcher with all arguments
|
|
exec "$LAUNCHER" "$@" |