#!/bin/sh
# Start the Jonia launcher with the bundled Java for this Mac's CPU.
# hw.optional.arm64 says what the chip is even when this shell runs under
# Rosetta (uname -m would say x86_64 there, and macOS warns that Intel apps
# are on their way out).
resources="$(cd "$(dirname "$0")/../Resources" && pwd)"
if [ "$(sysctl -n hw.optional.arm64 2>/dev/null)" = 1 ]; then
	runtime="$resources/runtime-arm64"
else
	runtime="$resources/runtime-x64"
fi
exec "$runtime/bin/java" "-Xdock:name=Jonia" -Xdock:icon="$resources/Jonia.icns" \
	-jar "$resources/jonia-launcher.jar" "$@"
