#!/bin/bash
# COURRIER pour Mac : ouvre COURRIER dans sa propre fenêtre.
SITE="https://coorier.pro"
DIR="$HOME/Library/Application Support/COURRIER"
mkdir -p "$DIR"
if [ -f "$DIR/premier-lancement.ok" ]; then URL="$SITE/app?source=mac"; else date > "$DIR/premier-lancement.ok"; URL="$SITE/bienvenue-application?source=mac"; fi
for APP in "Google Chrome" "Microsoft Edge" "Brave Browser" "Chromium"; do
  if open -Ra "$APP" >/dev/null 2>&1; then open -na "$APP" --args --app="$URL" --window-size=1280,860; exit 0; fi
done
open "$URL"
