#!/bin/sh
# Synex WhatsApp launcher
# Installed as /usr/bin/synex-whatsapp

APP_DIR="/opt/synex-messenger"
ELECTRON_BIN="$APP_DIR/node_modules/electron/dist/electron"

if [ ! -x "$ELECTRON_BIN" ]; then
    echo "Error: Electron binary not found: $ELECTRON_BIN" >&2
    exit 1
fi

cd "$APP_DIR" || exit 1

exec "$ELECTRON_BIN" "$APP_DIR/main.js" "$@"

