#!/usr/bin/env bash # # Launch script for "DB Browser for SQLite". # # The .app produced by build.sh is fully self-contained (Qt frameworks and the # cocoa platform plugin are bundled and linkage is rewritten to # @executable_path), so no DYLD_* variables are required. We still export # QT_PLUGIN_PATH pointing at the bundled plugins as a defensive measure, and run # the inner Mach-O binary directly so it deterministically inherits this # environment (macOS `open` does not forward shell env vars to the launched app). # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" APP_NAME="DB Browser for SQLite" # Locate the built .app relative to the script (no hardcoded absolute paths). APP="" for cand in \ "${APP_OUTPUT_DIR:-}/$APP_NAME.app" \ "$SCRIPT_DIR/$APP_NAME.app" \ "$SCRIPT_DIR/build/$APP_NAME.app"; do if [ -n "${cand#/}" ] && [ -d "$cand" ]; then APP="$cand" break fi done if [ -z "$APP" ]; then echo "ERROR: '$APP_NAME.app' not found. Run build.sh first." >&2 exit 1 fi BIN="$APP/Contents/MacOS/$APP_NAME" if [ ! -x "$BIN" ]; then echo "ERROR: executable not found inside bundle: $BIN" >&2 exit 1 fi # Point Qt at the bundle's own plugins (harmless with a self-contained bundle). export QT_PLUGIN_PATH="$APP/Contents/PlugIns" echo ">>> Launching: $APP" exec "$BIN" "$@"