#!/bin/bash
# Double-cliquez ce fichier si macOS refuse d'ouvrir BMS Kelasi.
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"
APP=""
if [ -d "$DIR/BMS Kelasi.app" ]; then
  APP="$DIR/BMS Kelasi.app"
elif [ -d "/Applications/BMS Kelasi.app" ]; then
  APP="/Applications/BMS Kelasi.app"
fi

if [ -z "$APP" ]; then
  osascript -e 'display alert "BMS Kelasi" message "Glissez d’abord BMS Kelasi.app dans le dossier Applications, puis relancez ce fichier." as informational'
  exit 1
fi

xattr -cr "$APP" 2>/dev/null || true
open "$APP"
